Repository navigation
[GLUTEN-12569][CORE] Fix compatibility issues addressed in Spark 4.2 - #13020
Merged
Merged
Conversation
|
Run Gluten Clickhouse CI on x86 |
manoj-ragupathy
force-pushed
the
feature/before_42
branch
from
September 14, 2026 19:30
f4518ed to
f673c8a
Compare
|
Run Gluten Clickhouse CI on x86 |
|
Run Gluten Clickhouse CI on x86 |
manoj-ragupathy
force-pushed
the
feature/before_42
branch
from
September 18, 2026 16:44
6a12fa5 to
0ec9583
Compare
|
Run Gluten Clickhouse CI on x86 |
Spark 4.2 added parameters to three case classes, which silently breaks positional extractor patterns: - CharType gained a collation parameter. - AppendDataExec / OverwriteByExpressionExec gained tableName and transaction. Match on type (and on the named field where a value is needed) instead, which is stable across all supported Spark versions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a4b4451c-d099-4965-871d-12781176d082 (cherry picked from commit b2a23c0)
Spark 4.2 hoisted checkAnswer, checkDataset, assertCached and friends out of QueryTest into a new QueryTestBase trait, which SharedSparkSession now mixes in. Because GlutenQueryTest declared its own copies of those members, every suite mixing both inherited conflicting definitions. Extending QueryTest (an abstract class up to 4.1, a trait in 4.2) makes Gluten's versions genuine overrides on every supported Spark version, and removes the duplicated-member conflict. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a4b4451c-d099-4965-871d-12781176d082 (cherry picked from commit a0c9f51)
- Spark 4.2 bumps Netty to 4.2.13, which removed PlatformDependent.allocateDirectNoCleaner. Use ByteBuffer.allocateDirect, which works on every supported version. - Spark 4.2's spark-catalyst ships a patched copy of datasketches ResourceImpl, tripping the ban-duplicate-classes enforcer. Both artifacts are 'provided', so nothing extra is packaged; ignore it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a4b4451c-d099-4965-871d-12781176d082 (cherry picked from commit 5d4853d)
…rk 4.2
Spark 4.2 adds `getBinaryView` to `SpecializedGetters`, which makes
`PlaceholderRow` (and any other `InternalRowSparkCompatible` subclass) fail to
compile as non-abstract:
BatchCarrierRow.scala:110: error: class PlaceholderRow needs to be abstract.
Missing implementation for member of trait SpecializedGetters:
def getBinaryView(x$1: Int): org.apache.spark.unsafe.types.BinaryView
Handled with the existing cross-version seam: `SpecializedGettersSparkCompatible`
gains a `getBinaryView` stub and `InternalRowSparkCompatible` overrides it. The
`Nothing` return type conforms to whichever concrete type the running Spark
version declares, so one definition covers the whole 3.x/4.x matrix -- exactly
how getVariant/getGeography/getGeometry are already handled.
Verified with clean builds (stale target/ classes previously masked this):
spark-3.4, spark-3.5, spark-4.0, spark-4.1 and spark-4.2 all BUILD SUCCESS.
(cherry picked from commit 7210d79)
Spark 4.2 moved postDriverMetrics to SupportsCustomDriverMetrics and made the reported task metrics an explicit argument. Move doPostDriverMetrics out of the version-agnostic BatchScanExecTransformer into each BatchScanExecShim so the call site can differ per version. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8ae7d6bd-f561-417a-a635-40fe24dc67a5
Two Spark 4.2 renames that leak into version-agnostic code: - SampleExec.seed became Option[Long], resolved lazily via resolvedSeed. - KeyGroupedPartitioning was renamed to KeyedPartitioning. Both are now hidden behind SparkShims (getSampleSeed, isKeyGroupedPartitioning) so gluten-substrait and backends-velox stay version-agnostic. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8ae7d6bd-f561-417a-a635-40fe24dc67a5
baibaichen
force-pushed
the
feature/before_42
branch
from
September 23, 2026 02:07
0ec9583 to
013b57c
Compare
|
Run Gluten Clickhouse CI on x86 |
This was referenced Sep 24, 2026
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?
Pre-work for Spark 4.2.x support (#12569), following the pattern of #11313 in the Spark 4.1 bring-up: land the small, self-contained compatibility fixes first so the shim-layer and unit-test PRs that follow stay reviewable.
Every change here is version-agnostic — this PR adds no
spark42paths and nospark-4.2profile. It only reshapes code that Spark 4.2 would otherwise break, in a way that works identically on Spark 3.4 through 4.1.doPostDriverMetricsout ofBatchScanExecTransformerinto eachBatchScanExecShimpostDriverMetricstoSupportsCustomDriverMetricsand made the reported task metrics an explicit argument, so the call site has to differ per versiongetSampleSeedtoSparkShimsSampleExec.seedbecameOption[Long], resolved lazily viaresolvedSeedisKeyGroupedPartitioningtoSparkShimsKeyGroupedPartitioningwas renamed toKeyedPartitioningConverterUtilsandGlutenNoopWriterRuleCharTypegainedcollation;AppendDataExecandOverwriteByExpressionExecgainedtableNameandtransaction, silently breaking positional extractor patternsGlutenQueryTestextend Spark'sQueryTestcheckAnswer,checkDataset,assertCachedand friends into a newQueryTestBasetrait thatSharedSparkSessionnow mixes in; becauseGlutenQueryTestdeclared its own copies, suites mixing both inherited conflicting definitions. ExtendingQueryTest(an abstract class up to 4.1, a trait in 4.2) makes Gluten's versions genuine overrides on every supported versiongetBinaryViewstub to theSpecializedGetterscompatibility shimsSpecializedGettersgainedgetBinaryViewin 4.2. The return type isNothingon purpose, matching the existinggetVariant/getGeography/getGeometrystubs, so one definition works across the whole 3.x/4.x matrixByteBuffer.allocateDirectinOnHeapFileSystemTestPlatformDependent.allocateDirectNoCleanerdatasketchesduplicate class inpackage/pom.xmlspark-catalystships a patched copy ofResourceImpl, tripping the ban-duplicate-classes enforcer. Both artifacts areprovided, so nothing extra is packagedThe two new
SparkShimsmethods are implemented in all existing version shims (spark34,spark35,spark40,spark41), keepinggluten-substraitandbackends-veloxversion-agnostic.Part of #12569.
How was this patch tested?
No behaviour change is intended on any currently supported Spark version, so this relies on existing test coverage.
Compile-verified on all four supported profiles:
All four report
BUILD SUCCESS. TheGlutenQueryTestchange is the highest-risk one here, since it affects every suite that mixes it withSharedSparkSession; it was verified on Spark 3.4 (the oldest supported version) as well as 4.1.Was this patch authored or co-authored using generative AI tooling?
Generated-by: GitHub Copilot CLI (Claude Opus 5)