fix: apply the session's Comet configs in map stages of jobs outside a SQL execution #7302
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.66) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.66 · 344 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.350
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.066
Real PR Conversation Timeline
1 comments
"Review active on #7302"
general
weight: 0.35
rich7420
Which issue does this PR close?
Closes #7301.
Rationale for this change
A job launched from a query's RDD (
Dataset.rddwith AQE off,QueryExecution.toRddwith AQE on or off) runs its map stages outside a SQL execution. On an executor,SQLConf.getthen reads task local properties that Spark has not filled, andSQLExecutionRDD(SPARK-28939) re-applies the session's configs only in the final stage. Comet reads its settings on the executor when it builds a native plan and when it reads a shuffle, so those map stages ran with everyspark.comet.setting at its default. That includes the memory pool, the batch size and the configs passed to native. There was no warning.What changes are included in this PR?
CapturedSQLConfcaptures the session'sspark.comet.configs on the driver.withConfmakes them whatSQLConf.getreturns on the task thread, usingSQLConf.withExistingConfasSQLExecutionRDDdoes. It does nothing when a conf is already set on the thread, or when Spark passed the task the session's configs as local properties (inside a SQL execution, or underSQLExecution.withSQLConfPropagated).CometExecRDD.compute, the native shuffle writer and the Celeborn writer's frame size (the configs ride onNativeShuffleSpec), the serialized-planCometExec.getCometIteratorused by the native limit and top-K, andCometShuffledBatchRDD.compute/computeAsShuffleBlockIterator.withSQLConfPropagatedworkarounds inCometJoinSuiteandCometTaskMetricsSuiteare no longer needed and are removed.Not covered here: the JVM columnar shuffle writers, tracked in #7303.
CometColumnarShuffleSuitekeeps its workaround until then. Native writes run inside a SQL execution, so they are not affected.How are these changes tested?
New
CometNativeShuffleSuitetests run a query from its RDD with AQE off, one per site:CometExecIteratorlogs when it creates a plan, that every native plan resolved the session's memory poolspark.comet.shuffle.readBufferSize=0, which fails only if the read sees the session's valueThe same query shapes in
spark-shell(Spark 4.1.1): before this change, map-stage plans resolvefair_unifiedand the intermediate shuffle read succeeds. After it, every plan resolves the session'sgreedy_unifiedand the read fails ascollect()does. The probe from #7301 resolves the submitted pool and fraction in the map stage in all five scenarios.