qlong commented on code in PR #15384:
URL: https://github.com/apache/iceberg/pull/15384#discussion_r2841607593


##########
api/src/main/java/org/apache/iceberg/expressions/InclusiveMetricsEvaluator.java:
##########
@@ -632,6 +633,8 @@ private boolean isNonNullPreserving(Bound<?> term) {
   }
 
   private static VariantObject parseBounds(ByteBuffer buffer) {
-    return Variant.from(buffer).value().asObject();
+    // Explicitly use little-endian encoding for reading buffer
+    ByteBuffer littleEndian = 
buffer.duplicate().order(ByteOrder.LITTLE_ENDIAN);

Review Comment:
   You are right that variant bounds are already stored as little-endian. 
However, ByteBuffer.wrap() in Java defaults to big-endian byte order, hence a 
mismatch when reading the manifest bound bytes. 
ParquetVariantReaders.readBinary has the same issue and also sets 
.order(ByteOrder.LITTLE_ENDIAN).



##########
api/src/test/java/org/apache/iceberg/expressions/TestPathUtil.java:
##########
@@ -123,4 +123,42 @@ public void testNormalizedFieldLists(List<String> fields, 
String normalizedPath)
   public void testPathEscaping(String name, String escaped) {
     assertThat(PathUtil.rfc9535escape(name)).isEqualTo(escaped);
   }
+
+  private static final String[][] TO_DOT_NOTATION_CASES =
+      new String[][] {
+        new String[] {"$", "$"},
+        new String[] {"$['a']", "$.a"},
+        new String[] {"$['a']['b']", "$.a.b"},

Review Comment:
   Yes, $['a']['b'] → $.a.b and $['a']['b']['c'] → $.a.b.c cover paths to 
nested variant object fields, which correspond to shredded struct fields within 
a variant. The variant extract path (e.g. $['address']['city']) is independent 
of where the variant column itself lives in the Iceberg schema — field 
navigation to the variant column is handled separately by BoundReference.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to