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


##########
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:
   Why do we only explain for array here? The result can be object / array or 
primitive.



##########
api/src/main/java/org/apache/iceberg/variants/VariantDataUtil.java:
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg.variants;
+
+import java.util.List;
+import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
+import org.apache.iceberg.relocated.com.google.common.base.Splitter;
+
+public class VariantDataUtil {

Review Comment:
   Keep package scope for now, same as VariantData?



##########
api/src/main/java/org/apache/iceberg/expressions/UnboundPredicate.java:
##########
@@ -124,13 +125,17 @@ public Expression bind(StructType struct, boolean 
caseSensitive) {
   private Expression bindUnaryOperation(BoundTerm<T> boundTerm) {
     switch (op()) {
       case IS_NULL:
-        if (boundTerm.ref().field().isRequired()) {
+        if (!boundTerm.producesNull()) {

Review Comment:
   I see this change is same as the one in `BoundReference` 
(field.isOptional()). For `BoundTransform`, seems we added 
`!transform.preservesOrder()` - which transforms produce nulls when not 
order-preserving?
   
   >    // transforms must produce null for null input values
   >     // transforms may produce null for non-null inputs when not 
order-preserving
   >     return ref.producesNull() || !transform.preservesOrder();



-- 
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