`CometBenchmarkBase.runExpressionBenchmark` checks the initial AQE plan, not the executed plan
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- scala, spark
- Ambito
- performance, testing
Direzione di ricerca
Read spark/src/test/scala/org/apache/spark/sql/benchmark/CometBenchmarkBase.scala and spark/src/test/scala/org/apache/spark/sql/comet/CometPlanChecker.scala. Start by checking how the benchmark executes its DataFrame and how the plan checker traverses AQE query stages. Done means the check inspects the final executed plan, recognizes the AQE wrapper nodes, and reports any non-native operator in that plan.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
Before timing a case, runExpressionBenchmark in
spark/src/test/scala/org/apache/spark/sql/benchmark/CometBenchmarkBase.scala checks that the
Comet plan is fully native:
// Check that the plan is fully Comet native before running the benchmark. Unlike the check
// above this one does execute the query, because AQE can re-plan a join after the first
// stage completes and the Comet operators are what we are checking for.
withSQLConf(cometConfigs: _*) {
val df = spark.sql(query)
df.noop()
val plan = stripAQEPlan(df.queryExecution.executedPlan)
findFirstNonCometOperator(plan).foreach { op => ...
df.noop() runs a separate write query. It does not execute df's own plan. After it,
df.queryExecution.executedPlan is still AdaptiveSparkPlan isFinalPlan=false, and
stripAQEPlan returns the initial plan. The check therefore never sees what AQE changes during
execution, which is what the comment says it is checking for. The warning it prints shows the
initial plan, not the plan that ran.
Steps to reproduce
Run on main (0f7f8e453) with the default profile (Spark 4.1.3), in a CometBenchmarkBase
subclass, over a Parquet table of 4096 rows made with
spark.range(4096).selectExpr("id % 10 AS k", "id AS v"), with
spark.comet.exec.shuffle.enabled=false. The query is SELECT k, sum(v) FROM t GROUP BY k.
- With the three lines above, after
df.noop(),df.queryExecution.executedPlanis
AdaptiveSparkPlan isFinalPlan=false. The plan that the check reads, and that the warning
prints, is
HashAggregate>Exchange>CometHashAggregate>CometNativeScan.
It has noCometColumnarToRow,AQEShuffleReadorShuffleQueryStage. - For a second DataFrame of the same query, after
collect(),
executedPlanisAdaptiveSparkPlan isFinalPlan=true, and the plan is
ResultQueryStage>HashAggregate>AQEShuffleRead coalesced>ShuffleQueryStage>
Exchange>CometColumnarToRow>CometHashAggregate>CometNativeScan.
Expected behavior
The check reads the plan that ran, after AQE has finished, and the warning prints that plan.
Additional context
Executing the DataFrame's own plan, for example with
df.queryExecution.executedPlan.execute().foreach(_ => ()), makes the plan final. The final plan
contains query stages. findFirstNonCometOperator in
spark/src/test/scala/org/apache/spark/sql/comet/CometPlanChecker.scala walks the plan with
foreach, which does not descend into a QueryStageExec (a leaf node), and its allow-list
contains neither QueryStageExec nor AQEShuffleReadExec. So a fix also needs the walk to go
into the query stages, for example through AdaptiveSparkPlanHelper, and to allow the AQE
wrapper nodes.
🤖 Generated with Claude Code
- Lingua principale
- Scala
- Stelle
- 1.3k
- Fork
- 414
- Merge medio
- 3g 5h
- PR unite (30g)
- 210
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/datafusion-comet
-
bug priority:medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
apache/datafusion-comet#7559 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
area:writer bug priority:low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/datafusion-comet#7558 ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/datafusion-comet#7557 ·
I maintainer di solito rispondono entro 2 giorni
-
`rand` and `randn` with an integer seed fall back to Spark without a fallback reasonForse già presa @galaxytemple l’ha presa 3 giorni fa. Apertarequires-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/datafusion-comet#7479 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
area:writer enhancement requires-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
apache/datafusion-comet#7463 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di apache/datafusion-comet
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
chipsalliance/rocket-chip#3845 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
I maintainer di solito rispondono entro 13 giorni
-
gesticulate: the `FastInfoset` suffix is written `fast-infoset`, not the registered `fastinfoset`Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
propensive/soundness#2437 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ergoplatform/ergo#2918 ·
I maintainer di solito rispondono entro 2 giorni