refactor: unify shuffle configs under spark.comet.shuffle.* prefix - #4986
Conversation
Shuffle-related configs were spread across four disjoint prefixes:
`spark.comet.exec.shuffle.*`, `spark.comet.columnar.shuffle.*`,
`spark.comet.native.shuffle.*`, and `spark.comet.shuffle.*`. This
consolidates all shuffle configs under `spark.comet.shuffle.*` with
`.columnar.` and `.native.` sub-namespaces for mode-specific settings.
Every renamed key is registered via `.withAlternative(...)`, so
existing user configurations continue to work (a deprecation warning
is logged when an old key is read). Per-mode leaves that were
previously misplaced move to their honest namespace:
- `spark.comet.exec.shuffle.writeBufferSize` (native-only) becomes
`spark.comet.shuffle.native.writeBufferSize`.
- `spark.comet.shuffle.preferDictionary.ratio` (JVM-only) becomes
`spark.comet.shuffle.columnar.preferDictionary.ratio`.
The `spark.comet.columnar.shuffle.*` keys also fix Category 2 in
apache#4978 (dots-in-segment): `spill.threshold`,
`memory.factor`, and `batch.size` become `spillThreshold`,
`memoryFactor`, and `batchSize`.
Part of apache#4978.
The JVM-side shuffle path in Comet is not the only columnar shuffle — native shuffle is also columnar (both use Arrow). The distinguishing axis is *where* the shuffle logic runs. Renaming the sub-namespace to `.jvm.` aligns it with the mode value users already set: `spark.comet.shuffle.mode = jvm`. Keys renamed: - spark.comet.shuffle.columnar.spillThreshold → spark.comet.shuffle.jvm.spillThreshold - spark.comet.shuffle.columnar.memoryFactor → spark.comet.shuffle.jvm.memoryFactor - spark.comet.shuffle.columnar.batchSize → spark.comet.shuffle.jvm.batchSize - spark.comet.shuffle.columnar.preferDictionary.ratio → spark.comet.shuffle.jvm.preferDictionary.ratio The pre-existing deprecated aliases (`spark.comet.columnar.shuffle.*`) are untouched — they were never `.columnar.`-scoped under the new prefix. Val names follow: `COMET_SHUFFLE_COLUMNAR_*` → `COMET_SHUFFLE_JVM_*`. The Scala/Java class names (`CometColumnarShuffle`, `CometColumnarShuffleSuite`, etc.) still use "columnar" and are left alone — that is a separate rename to consider once the config vocabulary settles.
Table column alignment tweaks after the `.columnar.` → `.jvm.` key rename. Content unchanged.
Resolves conflicts introduced by apache/main apache#4985 (remove untested async columnar shuffle) against this branch's shuffle-config renames: - Accept deletion of CometShuffleExternalSorterAsync/Sync and the merged-back CometShuffleExternalSorter; propagate this branch's jvm.* renames to the merged class (COMET_SHUFFLE_JVM_SPILL_THRESHOLD, COMET_SHUFFLE_JVM_PREFER_DICTIONARY_RATIO, COMET_SHUFFLE_COMPRESSION_*). - Drop async-config rows from jvm_shuffle.md and async-mode benchmark cases from CometShuffleBenchmark; drop the async-branch conditionals from CometColumnarShuffleSuite. - Fold the newly-introduced COMET_COLUMNAR_SHUFFLE_MAX_WRITERS_PER_EXECUTOR into this branch's naming: rename to COMET_SHUFFLE_JVM_MAX_WRITERS_PER_EXECUTOR (key spark.comet.shuffle.jvm.maxWritersPerExecutor), keeping both prior names as .withAlternative fallbacks. - Rename remaining spark.comet.exec.shuffle.mode occurrences in three make_time_shuffle*.sql test files to the new spark.comet.shuffle.mode.
# Conflicts: # spark/src/main/scala/org/apache/spark/sql/comet/execution/shuffle/CometNativeShuffleWriter.scala
Regenerate the Spark SQL test diffs to reference shuffle configs by their string keys rather than CometConf constants, so the config rename in this PR no longer breaks test compilation. - spark.comet.exec.shuffle.enabled -> spark.comet.shuffle.enabled - CometConf.COMET_EXEC_SHUFFLE_WITH_RANGE_PARTITIONING_ENABLED.key -> "spark.comet.shuffle.native.partitioning.range.enabled"
comphead
left a comment
There was a problem hiding this comment.
Thanks @andygrove Athough we used exec.shuffle before, I checked spark conf and they used just spark.shuffle.
However this is a super breaking change, people using Comet would have to reconfigure their jobs. I'm not sure about migration path
We should prob start the same idea we have started in DF with upgrade guide, otherwise migration would be painful |
This is not a breaking changes. All the original configs are still supported but deprecated. |
Example from this PR: val COMET_SHUFFLE_DIRECT_READ_ENABLED: ConfigEntry[Boolean] =
conf("spark.comet.shuffle.directRead.enabled")
.withAlternative(s"$COMET_EXEC_CONFIG_PREFIX.shuffle.directRead.enabled")
... |
# Conflicts: # benchmarks/pyspark/run_all_benchmarks.sh # spark/src/test/scala/org/apache/comet/CometConfSuite.scala
mbutrovich
left a comment
There was a problem hiding this comment.
One minor change, I think. Thanks @andygrove!
| | `spark.comet.shuffle.mode` | `auto` | Shuffle mode: `native`, `jvm`, or `auto` | | ||
| | `spark.comet.shuffle.compression.codec` | `zstd` | Compression codec | | ||
| | `spark.comet.shuffle.compression.zstd.level` | `1` | Zstd compression level | | ||
| | `spark.comet.shuffle.write.buffer.size` | `1MB` | Write buffer size | |
There was a problem hiding this comment.
the Configuration table's write-buffer-size row still shows spark.comet.shuffle.write.buffer.size, which is not a valid config key (the actual key was spark.comet.exec.shuffle.writeBufferSize, now spark.comet.shuffle.native.writeBufferSize). Every other row in this same table was correctly renamed by this PR; this one was missed. Update to spark.comet.shuffle.native.writeBufferSize.
There was a problem hiding this comment.
@mbutrovich could we merge this one and then do a separate docs-only follow up? Save some CI time...
There was a problem hiding this comment.
Sure. You have some stacked docs-only PRs behind this one, I think,
mbutrovich
left a comment
There was a problem hiding this comment.
Approved with the caveat of fixing the followup in one of the stacked PRs.
…pache#4986) * refactor: unify shuffle configs under `spark.comet.shuffle.*` prefix Shuffle-related configs were spread across four disjoint prefixes: `spark.comet.exec.shuffle.*`, `spark.comet.columnar.shuffle.*`, `spark.comet.native.shuffle.*`, and `spark.comet.shuffle.*`. This consolidates all shuffle configs under `spark.comet.shuffle.*` with `.columnar.` and `.native.` sub-namespaces for mode-specific settings. Every renamed key is registered via `.withAlternative(...)`, so existing user configurations continue to work (a deprecation warning is logged when an old key is read). Per-mode leaves that were previously misplaced move to their honest namespace: - `spark.comet.exec.shuffle.writeBufferSize` (native-only) becomes `spark.comet.shuffle.native.writeBufferSize`. - `spark.comet.shuffle.preferDictionary.ratio` (JVM-only) becomes `spark.comet.shuffle.columnar.preferDictionary.ratio`. The `spark.comet.columnar.shuffle.*` keys also fix Category 2 in apache#4978 (dots-in-segment): `spill.threshold`, `memory.factor`, and `batch.size` become `spillThreshold`, `memoryFactor`, and `batchSize`. Part of apache#4978. * refactor: rename `.columnar.` sub-namespace to `.jvm.` The JVM-side shuffle path in Comet is not the only columnar shuffle — native shuffle is also columnar (both use Arrow). The distinguishing axis is *where* the shuffle logic runs. Renaming the sub-namespace to `.jvm.` aligns it with the mode value users already set: `spark.comet.shuffle.mode = jvm`. Keys renamed: - spark.comet.shuffle.columnar.spillThreshold → spark.comet.shuffle.jvm.spillThreshold - spark.comet.shuffle.columnar.memoryFactor → spark.comet.shuffle.jvm.memoryFactor - spark.comet.shuffle.columnar.batchSize → spark.comet.shuffle.jvm.batchSize - spark.comet.shuffle.columnar.preferDictionary.ratio → spark.comet.shuffle.jvm.preferDictionary.ratio The pre-existing deprecated aliases (`spark.comet.columnar.shuffle.*`) are untouched — they were never `.columnar.`-scoped under the new prefix. Val names follow: `COMET_SHUFFLE_COLUMNAR_*` → `COMET_SHUFFLE_JVM_*`. The Scala/Java class names (`CometColumnarShuffle`, `CometColumnarShuffleSuite`, etc.) still use "columnar" and are left alone — that is a separate rename to consider once the config vocabulary settles. * chore: re-run prettier on shuffle docs Table column alignment tweaks after the `.columnar.` → `.jvm.` key rename. Content unchanged. * style: apply spotless formatting to CometShuffleExternalSorter * refactor: move maxBufferBytes under spark.comet.shuffle.native prefix * test: update Spark diffs for renamed shuffle configs Regenerate the Spark SQL test diffs to reference shuffle configs by their string keys rather than CometConf constants, so the config rename in this PR no longer breaks test compilation. - spark.comet.exec.shuffle.enabled -> spark.comet.shuffle.enabled - CometConf.COMET_EXEC_SHUFFLE_WITH_RANGE_PARTITIONING_ENABLED.key -> "spark.comet.shuffle.native.partitioning.range.enabled"
Summary
Part of #4978 (Category 2 + Category 4).
Shuffle-related configs live under four disjoint prefixes today:
spark.comet.exec.shuffle.*,spark.comet.columnar.shuffle.*,spark.comet.native.shuffle.*, andspark.comet.shuffle.*. This PRconsolidates all shuffle configs under
spark.comet.shuffle.*with.jvm.and.native.sub-namespaces for mode-specific settings,and fixes the dots-in-segment naming for the four JVM-shuffle keys.
The sub-namespaces (
.jvm./.native.) match the values users alreadyset on
spark.comet.shuffle.mode(jvm/native/auto). Note thatboth modes are columnar (both use Arrow); the distinction is where the
shuffle logic runs, so
.jvm.is the honest name.Every renamed key is registered via
.withAlternative(...), soexisting user configurations keep working (a one-time deprecation
warning is logged per old key). No behavior change.
Rename table
Master / shared (both modes):
spark.comet.exec.shuffle.enabledspark.comet.shuffle.enabledspark.comet.exec.shuffle.modespark.comet.shuffle.modespark.comet.exec.shuffle.directRead.enabledspark.comet.shuffle.directRead.enabledspark.comet.exec.shuffle.convertFromSparkPlan.enabledspark.comet.shuffle.convertFromSparkPlan.enabledspark.comet.exec.shuffle.revertRedundantColumnar.enabledspark.comet.shuffle.revertRedundantColumnar.enabledspark.comet.exec.shuffle.compression.codecspark.comet.shuffle.compression.codecspark.comet.exec.shuffle.compression.zstd.levelspark.comet.shuffle.compression.zstd.levelNative-shuffle-only (moved from
spark.comet.native.shuffle.*and one leaf fromspark.comet.exec.shuffle.*):spark.comet.exec.shuffle.writeBufferSizespark.comet.shuffle.native.writeBufferSizespark.comet.native.shuffle.partitioning.hash.enabledspark.comet.shuffle.native.partitioning.hash.enabledspark.comet.native.shuffle.partitioning.range.enabledspark.comet.shuffle.native.partitioning.range.enabledspark.comet.native.shuffle.partitioning.roundrobin.enabledspark.comet.shuffle.native.partitioning.roundrobin.enabledspark.comet.native.shuffle.partitioning.roundrobin.maxHashColumnsspark.comet.shuffle.native.partitioning.roundrobin.maxHashColumnsJVM-shuffle-only (moved from
spark.comet.columnar.shuffle.*; also fixes Category 2 dots-in-segment):spark.comet.columnar.shuffle.spill.thresholdspark.comet.shuffle.jvm.spillThresholdspark.comet.columnar.shuffle.memory.factorspark.comet.shuffle.jvm.memoryFactorspark.comet.columnar.shuffle.batch.sizespark.comet.shuffle.jvm.batchSizespark.comet.shuffle.preferDictionary.ratiospark.comet.shuffle.jvm.preferDictionary.ratiopreferDictionary.ratioandwriteBufferSizewere previously atmode-agnostic namespaces but their doc/call sites confirm they are
JVM-only and native-only respectively; the rename puts them in their
honest place.
Not in this PR
spark.comet.columnar.shuffle.max.writers.per.executorisn'trenamed here — the val
COMET_COLUMNAR_SHUFFLE_MAX_WRITERS_PER_EXECUTORis introduced by Bug triage results: 2026-07-20 #4980 (async columnar shuffle removal), which hasn't
landed on main yet. A tiny follow-up PR can add its rename once Bug triage results: 2026-07-20 #4980
merges.
spark.comet.columnar.shuffle.async.*keys are being removed byBug triage results: 2026-07-20 #4980 — left alone here.
CometColumnarShuffle,CometColumnarShuffleSuite,etc.) still use "columnar" — that is a separate rename to consider once
the config vocabulary settles.
Test plan
./mvnw -Pspark-3.5 test -pl spark -Dsuites="org.apache.comet.CometConfSuite"— 10 tests pass (including 3 new alias tests for the renames)./mvnw -Pspark-3.5 spotless:check— cleancompile test-compileunder Spark 3.5 — clean