nandorKollar commented on code in PR #13935:
URL: https://github.com/apache/iceberg/pull/13935#discussion_r2306491050


##########
arrow/src/main/java/org/apache/iceberg/arrow/vectorized/VectorizedArrowReader.java:
##########
@@ -142,6 +142,9 @@ public VectorHolder read(VectorHolder reuse, int 
numValsToRead) {
     if (reuse == null
         || (!dictEncoded && readType == ReadType.DICTIONARY)
         || (dictEncoded && readType != ReadType.DICTIONARY)) {
+      if (vec != null) {

Review Comment:
   @stevenzwu recommendation sounds reasonable to me, maybe sounds even better 
than mine. I wouldn't copy this close logic into each leaf methods, because if 
once in the future `allocateFieldVector` is modified so that allocation is done 
by a new criteria, and a new leaf method is added, it is very easy to miss this 
close check there. I vote for Steven's recommendation, adding the close logic 
to a single place, in `allocateFieldVector` method.



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