aokolnychyi commented on a change in pull request #3533:
URL: https://github.com/apache/iceberg/pull/3533#discussion_r748672195



##########
File path: 
arrow/src/main/java/org/apache/iceberg/arrow/vectorized/NullabilityHolder.java
##########
@@ -75,6 +77,7 @@ public int numNulls() {
   }
 
   public void reset() {
+    // TODO: do we have reset the values too?

Review comment:
       I think this can be resolved now.

##########
File path: 
arrow/src/main/java/org/apache/iceberg/arrow/vectorized/NullabilityHolder.java
##########
@@ -52,10 +52,12 @@ public void setNotNull(int index) {
   }
 
   public void setNulls(int startIndex, int num) {
+    // TODO: do we have to modify numNulls?

Review comment:
       Fixed.

##########
File path: 
arrow/src/main/java/org/apache/iceberg/arrow/vectorized/VectorizedArrowReader.java
##########
@@ -407,26 +412,36 @@ public void setBatchSize(int batchSize) {
   }
 
   private static final class PositionVectorReader extends 
VectorizedArrowReader {
+    private final Field arrowField = 
ArrowSchemaUtil.convert(MetadataColumns.ROW_POSITION);
+    private final BufferAllocator bufferAllocator = 
ArrowAllocation.rootAllocator();
+    private final boolean setArrowValidityVector;
     private long rowStart;
+    private int batchSize;
+    private FieldVector vec;
     private NullabilityHolder nulls;
 
+    PositionVectorReader(boolean setArrowValidityVector) {
+      this.setArrowValidityVector = setArrowValidityVector;
+    }
+
     @Override
     public VectorHolder read(VectorHolder reuse, int numValsToRead) {
-      Field arrowField = ArrowSchemaUtil.convert(MetadataColumns.ROW_POSITION);
-      FieldVector vec = 
arrowField.createVector(ArrowAllocation.rootAllocator());
-
-      if (reuse != null) {
+      if (reuse == null) {
+        this.vec = newVector();
+        this.nulls = new NullabilityHolder(batchSize);

Review comment:
       Switched.




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