You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "huan233usc (via GitHub)" <gi...@apache.org> on 2026/07/02 03:51:10 UTC

Re: [PR] Spark: Fix ColumnVectorWithFilter child vectors [iceberg]

huan233usc commented on code in PR #16913:
URL: https://github.com/apache/iceberg/pull/16913#discussion_r3510349121


##########
spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/ColumnVectorWithFilter.java:
##########
@@ -137,14 +142,21 @@ public ColumnVector getChild(int ordinal) {
     if (children == null) {
       synchronized (this) {
         if (children == null) {
+          int numChildren;
           if (dataType() instanceof StructType) {
             StructType structType = (StructType) dataType();
-            this.children = new ColumnVectorWithFilter[structType.length()];
-            for (int index = 0; index < structType.length(); index++) {
-              children[index] = new ColumnVectorWithFilter(delegate.getChild(index), rowIdMapping);
-            }
+            numChildren = structType.length();
+          } else if (dataType() instanceof CalendarIntervalType) {
+            numChildren = NUM_INTERVAL_CHILDREN;
+          } else if (dataType() instanceof VariantType) {
+            numChildren = NUM_VARIANT_CHILDREN;

Review Comment:
   cc @nssalian as some similar changes are also done in variant's vectorized reader pr
   
   https://github.com/apache/iceberg/pull/16292/changes#diff-88a1429a7744bd132837f5a7bc9a6f5108e9e3f6a41f5232cf63e035cd791931



-- 
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-unsubscribe@iceberg.apache.org

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


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