Repository navigation
Conversation
|
Failed to query issues imported from #13648: Error 1045 (28000): Access denied for user 'presto'@'10.167.107.7' (using password: YES) |
|
Run Gluten Clickhouse CI on x86 |
This was referenced Nov 16, 2026
|
Run Gluten Clickhouse CI on x86 |
This was referenced Nov 16, 2026
Open
LanceArrowBatchScan switches a Lance BatchScanExec to lance-spark's Arrow batch reads (LanceScan.withArrowBatches, lance-spark#908) when Velox imports every column type of them, and VeloxLanceComponent declares those batches as ArrowJavaBatchType, so Gluten offloads them with its Arrow transitions. The vanilla BatchScanExec stays in the plan and keeps lance-spark's runtime filters, output partitioning and metrics. LanceScanTransformer and OffloadLanceScan are removed. OffloadArrowDataExec now closes the batches that ColumnarBatches.offload builds from Spark ArrowColumnVectors, which nothing closed before. Generated-by: Claude Opus 5.5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Velox imports both, and Gluten runs TIMESTAMP_NTZ natively by default. ArrowColumnVectors.adopt and copy now handle a NullVector, whose getAllocator() throws. Generated-by: Claude Opus 5.5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sezruby
force-pushed
the
feat/lance-arrow-batches
branch
from
November 26, 2026 16:33
3118c49 to
084ac16
Compare
|
Run Gluten Clickhouse CI on x86 |
This branch has not been deployed
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.
What changes are proposed in this pull request?
Lance scans are offloaded through lance-spark's Arrow batch reads (lance-format/lance-spark#908) instead of
LanceScanTransformer, as proposed in #12958 (comment).Builds on #13732, which moved the Lance scan into the
gluten-lancemodule.LanceArrowBatchScan, a pre-transform rule, switches a LanceBatchScanExecto Arrow batches (LanceScan.withArrowBatches()) when lance-spark can emit them and Velox imports every column type of them.VeloxLanceComponent.convFuncOverridedeclares those batches asArrowJavaBatchType, so Gluten plansBatchScanExec→OffloadArrowDataExec→ArrowColumnarToVeloxColumnarExecfor a Velox consumer, and onlyColumnarToRowExecfor a row-based one.BatchScanExec, so it keeps lance-spark's runtime filters, output partitioning and custom metrics, whichLanceScanTransformerand its RDD dropped.TIMESTAMP_NTZand null columns are offloaded.ArrowColumnVectors.adoptandcopyhandle aNullVector, which has no allocator:adoptcalledgetAllocator()on it and failed withTried to get allocator from NullVector. This is decided at planning time from the Arrow schema lance-spark reports, which also covers the scans [GLUTEN-13487][VL] Fall back Lance scans the Arrow stream cannot carry #13554 keeps on vanilla Spark.LanceScanTransformer,OffloadLanceScanand theFixedSizeListrewrite are removed: lance-spark's Arrow batches already carry vectors as lists. This leavesgluten-lancewithout sources until the Lance write code moves there.LanceArrowBatchScanis inbackends-velox/src-lancebecause it checks the column types Velox imports.OffloadArrowDataExecnow closes the batches thatColumnarBatches.offloadbuilds from SparkArrowColumnVectors. For such a batchoffloadreturns a new batch and leaves the input to its producer, but nothing closed the new one, so tasks ended with "There are still unreleased native columnar batches during ending the task."VeloxLanceSuitelogged it 15 times before this change and doesn't now.lance.versionis 0.9.1-beta.2, the first lance-spark release with Import more datasource tests #908.VeloxLance.md, andArrowColumnarConversion.md, which usedLanceScanTransformeras its example.Without pruning, this path is slower than
LanceScanTransformer, becauseadoptcopies each batch: lance-spark allocates them from Spark's Arrow allocator, and Gluten's task allocator is a separate root. In an emulated benchmark the copy cost up to 21% (#12958). A follow-up removes the copy by having lance-spark build the batches in Gluten's task allocator. That follow-up is lance-format/lance-spark#966, tracked in sezruby#1. It waits for Arrow Java fixes for imports that run out of memory.Runtime filters apply on this path because the
BatchScanExecstays (LanceScanTransformerplanned every partition); lance-spark takes them on Spark 4.1+ (lance-format/lance-spark#927).Known issue on this path:
How was this patch tested?
VeloxLanceSuite: the existing tests now check that the Lance scan reads Arrow batches and, for a pushed aggregation, that it doesn't; a new test readsTIMESTAMP_NTZand null columns through the offloaded scan, also under a Velox aggregate and sort. Each test compares with vanilla Spark throughrunQueryAndCompare.ArrowColumnVectorTest: offloading a batch of SparkArrowColumnVectors with a null column. It fails on main withTried to get allocator from NullVector.ColumnarBatchTest:OffloadArrowDataExec's iterator closes the batch it built from SparkArrowColumnVectors when the next batch is requested and on close, and leaves a Gluten batch to its producer.Ran them on Spark 3.5 against lance-spark 0.9.1-beta.2 and the Velox native libraries of the 2026-11-26 nightly build:
VeloxLanceSuite12,ColumnarBatchTest8 andArrowColumnVectorTest7 tests pass. Compiles on Spark 4.0 / Scala 2.13.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 5.5
🤖 Generated with Claude Code