viirya commented on code in PR #59871:
URL: https://github.com/apache/spark/pull/59871#discussion_r4404598129


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/python/PythonArrowOutputSuite.scala:
##########
@@ -132,6 +135,72 @@ class PythonArrowOutputSuite extends SparkFunSuite {
     }
   }
 
+  test("SPARK-60627: slice by records: a batch that Arrow cannot slice is 
output whole") {
+    val allocator = ArrowUtils.rootAllocator.newChildAllocator("unsliceable", 
0, Long.MaxValue)
+    // An array column that reports 2^29 + 2^20 rows without allocating them, 
so its offsets take
+    // over 2 GiB. Arrow computes the positions of the offsets of a slice in 
int, so a slice that
+    // reaches row 2^29 throws and leaks the vectors sliced so far. The 
fixed-width vectors that

Review Comment:
   You're right, thanks for the correction: `StructTransferPair` re-creates the 
child with `addOrGet(child, ..., vector.getClass())`, and `clazz.cast` of a 
plain `ListVector` to the anonymous subclass throws before `splitAndTransfer` 
runs. The updated comment and description read well.



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