shardulm94 commented on a change in pull request #1356:
URL: https://github.com/apache/iceberg/pull/1356#discussion_r488436987



##########
File path: 
arrow/src/main/java/org/apache/iceberg/arrow/vectorized/VectorHolder.java
##########
@@ -131,4 +140,10 @@ public Object getConstant() {
     }
   }
 
+  public static class PositionVectorHolder extends VectorHolder {

Review comment:
       Seems like technically this class is redundant since the user can use 
VectorHolder directly, but is probably good for readability.

##########
File path: 
arrow/src/main/java/org/apache/iceberg/arrow/vectorized/VectorizedArrowReader.java
##########
@@ -354,6 +360,40 @@ public void setBatchSize(int batchSize) {
     }
   }
 
+  private static final class PositionVectorReader extends 
VectorizedArrowReader {
+    private long rowStart;
+
+    @Override
+    public VectorHolder read(VectorHolder reuse, int numValsToRead) {
+      Field arrowField = ArrowSchemaUtil.convert(MetadataColumns.ROW_POSITION);
+      FieldVector vec = 
arrowField.createVector(ArrowAllocation.rootAllocator());
+      ((BigIntVector) vec).allocateNew(numValsToRead);

Review comment:
       Can this follow an approach similar to `VectorizedArrowReader` and not 
create a new `FieldVector` and `NullabilityHolder` for every invocation?
   
https://github.com/apache/iceberg/blob/52f44687a533f0d9b9895c9dc4326b7ef7785654/arrow/src/main/java/org/apache/iceberg/arrow/vectorized/VectorizedArrowReader.java#L123-L125

##########
File path: 
arrow/src/main/java/org/apache/iceberg/arrow/vectorized/VectorHolder.java
##########
@@ -131,4 +140,10 @@ public Object getConstant() {
     }
   }
 
+  public static class PositionVectorHolder extends VectorHolder {

Review comment:
       Seems like technically this class is redundant since the user can use 
VectorHolder directly, but is probably good for readability?




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

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