nssalian commented on code in PR #16292:
URL: https://github.com/apache/iceberg/pull/16292#discussion_r3352459386


##########
arrow/src/main/java/org/apache/iceberg/arrow/vectorized/VectorizedArrowReader.java:
##########
@@ -958,4 +958,50 @@ public String toString() {
     @Override
     public void setBatchSize(int batchSize) {}
   }
+
+  public static class VectorizedVariantReader extends VectorizedArrowReader {
+    private final VectorizedArrowReader metadataReader;
+    private final VectorizedArrowReader valueReader;
+
+    public VectorizedVariantReader(
+        Types.NestedField icebergField,
+        VectorizedArrowReader metadataReader,
+        VectorizedArrowReader valueReader) {
+      super(icebergField);
+      this.metadataReader = metadataReader;
+      this.valueReader = valueReader;
+    }
+
+    @Override
+    public VectorHolder read(VectorHolder reuse, int numValsToRead) {
+      VectorHolder metadataHolder = metadataReader.read(null, numValsToRead);

Review Comment:
   Thanks for the suggestion. I've reused the VectorHolder for both metadata 
and value.



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