danielcweeks commented on code in PR #12304:
URL: https://github.com/apache/iceberg/pull/12304#discussion_r1964369050


##########
api/src/main/java/org/apache/iceberg/variants/Variant.java:
##########
@@ -25,4 +25,24 @@ public interface Variant {
 
   /** Returns the variant value. */
   VariantValue value();
+
+  /**
+   * Query the value with a given path.
+   *
+   * <p>The path format is a subset of JSON path that supports:
+   *
+   * <ul>
+   *   <li><code>$</code> the root value
+   *   <li><code>.name</code> accesses a field by name
+   * </ul>
+   *
+   * <p>If the query result is a list, the value is a variant array of results.

Review Comment:
   I think there's potential for ambiguity here since the extract could produce 
a list of matched elements or a list of lists, which would be difficult to 
distinguish.  I believe if we want to be complaint with [RFC 
9535](https://datatracker.ietf.org/doc/rfc9535/) we would always return a list.
   
   There are ways to work around this, for example Trino supports syntax for 
"conditional wrapper" or "unconditional wrapper".  They also support separate 
access methods for `query` (multiple results) vs `value` (explicit single 
result).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to