Cover Spark 4.2 Arrow Python UDF columnar input [fast-ut] [reduced-it][databricks] - #15885
Open
firestarman wants to merge 3 commits into
Open
Cover Spark 4.2 Arrow Python UDF columnar input [fast-ut] [reduced-it][databricks]#15885firestarman wants to merge 3 commits into
firestarman wants to merge 3 commits into
Conversation
Spark 4.2 CPU ArrowEvalPythonExec can retain pass-through ColumnVector references, so the test Arrow source must not free earlier batches until the reader closes. Add GPU coverage for that Arrow input path and for a CPU Python exec above a GPU scan. Signed-off-by: Firestarman <firestarmanllc@gmail.com>
Contributor
Greptile SummaryAdds Spark 4.2 integration coverage for Arrow-backed Python UDF input and adjusts the test DataSource V2 reader’s Arrow resource lifetime.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Arrow DataSource V2 batch] --> B{Execution path}
B -->|GPU UDF| C[HostColumnarToGpu]
C --> D[GpuArrowEvalPythonExec]
B -->|CPU fallback| E[GPU Parquet scan]
E --> F[Host transition]
F --> G[ArrowEvalPythonExec]
A --> H[Consumer releases vectors]
H --> I[Reader allocator cleanup]
Reviews (3): Last reviewed commit: "Merge branch 'main' into audit/15663-arr..." | Re-trigger Greptile |
Spark 4.2 closes the partition reader before SPARK-56350 CPU ArrowEvalPythonExec drops pass-through vectors, so closing batches in reader.close() UAFs. Close the allocator only when allocated memory is zero, and use in-range ints for pandas UDF Arrow casts on Spark 4.x. Signed-off-by: Firestarman <firestarmanllc@gmail.com>
Collaborator
Author
|
build |
Collaborator
Author
|
build |
res-life
reviewed
Sep 4, 2026
| private val rootAllocator = new RootAllocator(Long.MaxValue) | ||
| private val allocator: BufferAllocator = | ||
| rootAllocator.newChildAllocator(s"arrow-test-reader-$startNum", 0, Long.MaxValue) | ||
| private val allBatches = new util.ArrayList[ColumnarBatch]() |
Collaborator
There was a problem hiding this comment.
Forget to close this columnar batch list?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #15663.
Description
Spark 4.2 (
SPARK-56350) lets CPUArrowEvalPythonExecconsume Arrow-backedColumnarBatchinput and skipColumnarToRow. That does not change the GPU Python UDF path (GpuColumnVector-> cuDF Arrow IPC), but it does change how tests and CPU fallbacks must behave.ArrowEvalPythonExeccan retain pass-throughColumnVectorreferences; this is CPU ownership, notGpuArrowEvalPythonExec.HostColumnarToGpu+GpuArrowEvalPythonExec.evalType=101) coverage. CPUspark.sql.execution.arrow.pythonUDF.columnarInput.enabledis disabled only to avoid the Spark 4.2.0 hang fromSPARK-58241; that is a CPU bug, not a GPU bug.ArrowEvalPythonExecsoGpuColumnVectoris not handed to Spark's CPU Arrow UDF path.There is no user-facing config or execution-path change.
Checklists
Documentation
Testing
(Please provide the names of the existing tests in the PR description.)
New/updated tests:
test_arrow_source_pandas_udftest_arrow_source_regular_udftest_pandas_udf_cpu_arrow_eval_after_gpu_scanPerformance