tomvanbussel commented on a change in pull request #33108:
URL: https://github.com/apache/spark/pull/33108#discussion_r659551783



##########
File path: 
sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/WritableColumnVector.java
##########
@@ -611,6 +611,9 @@ public final int appendByteArray(byte[] value, int offset, 
int length) {
 
   public final int appendArray(int length) {
     reserve(elementsAppended + 1);
+    for (WritableColumnVector childColumn : childColumns) {
+      childColumn.reserve(childColumn.elementsAppended + length);
+    }

Review comment:
       I don't think this would work for `Map`, as in that case there are 2 
child column vectors but `appendArray()` is still used. Alternatively I could 
fix this by putting these reserves in `ArrayConverter` and `MapConverter`. Then 
we could manually unroll those loops there, but code that uses `appendArray` 
would have to be careful to call reserve on the child vectors before calling 
`appendArray`. WDYT?




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