chore: remove dead useDecimal128 plumbing#4382
Open
andygrove wants to merge 2 commits into
Open
Conversation
The internal `spark.comet.use.decimal128` conf had three write-only callers and zero readers. The `useDecimal128` boolean threaded through the entire `CometVector` hierarchy was always `true` in production (both `NativeUtil` call sites hardcoded `true`), so the `false` branch of `CometVector.getDecimal()` was unreachable. The Rust `SparkParquetOptions.use_decimal_128` field was declared, defaulted to `false`, and never read. Removed: - `CometConf.COMET_USE_DECIMAL_128` and its three `setConfString` writers - `useDecimal128` field/parameter across `CometVector` and all subclasses - The dead branch in `CometVector.getDecimal()` - `use_decimal_128` from `SparkParquetOptions` - The `Seq(true, false).foreach` sweep in `ParquetReadSuite "decimals"`
# Conflicts: # spark/src/main/scala/org/apache/spark/sql/comet/operators.scala
mbutrovich
approved these changes
May 22, 2026
Contributor
mbutrovich
left a comment
There was a problem hiding this comment.
Thanks for finding the dead code, @andygrove!
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.
Which issue does this PR close?
Closes #.
Rationale for this change
The internal
spark.comet.use.decimal128conf is dead plumbing:CometExecRule,CometShuffleExchangeExec,CometNativeExec.doExecuteColumnar) force it to"true"right before native execution, but nothing reads it anywhere in the repo.useDecimal128boolean threaded through the entireCometVectorhierarchy is alwaystruein production. BothNativeUtil.importVectorandNativeUtil.rootAsBatchhardcodetrue, so the!useDecimal128branch inCometVector.getDecimal()is unreachable.SparkParquetOptions.use_decimal_128field is declared, defaulted tofalsein both::newconstructors, and never set or read elsewhere.This looks like legacy from the era when the JVM Parquet reader produced Decimal32/Decimal64 vectors. With the native scan path being the only path, every decimal column already lands in 128-bit form before reaching the JVM.
What changes are included in this PR?
CometConf.COMET_USE_DECIMAL_128and its threesetConfStringwriters.useDecimal128field and constructor parameter fromCometVector,CometDecodedVector,CometPlainVector,CometDictionaryVector,CometListVector,CometMapVector,CometStructVector,CometDelegateVector,CometSelectionVector.CometVector.getDecimal()to the always-128-bit path.truearg from bothNativeUtilcallers ofCometVector.getVectorand from the codegen template inCometBatchKernelCodegenInput.use_decimal_128fromSparkParquetOptionsand clean up three stale comments incolumnar_to_row.rsthat referenced the conf.TestColumnReadercallers to the simplified constructor.How are these changes tested?
Covered by existing tests:
ParquetReadV1Suite "decimals": passes (Standard + Legacy modes plus sibling decimal tests).CometShuffleSuite "fix: StreamReader should read shuffled decimal columns as Decimal128": passes (renamed from the olduseDecimal128regression test, still pinsNativeUtil.rootAsBatchagainst decimal-128 expectation).Seq(true, false).foreach { useDecimal128 => ... }sweep inParquetReadSuite "decimals"was flattened since the conf no longer exists; the remaining batch-size and precision matrix still exercises the decimal read path.makeandcargo clippy --all-targets --workspace -- -D warningsboth green.