-
Notifications
You must be signed in to change notification settings - Fork 28.7k
[SPARK-33850][SQL] EXPLAIN FORMATTED doesn't show the plan for subqueries if AQE is enabled #30855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
165cd91
35f127a
2ee8d19
6cbe6a6
577dd8f
13fb225
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -277,6 +277,28 @@ class ExplainSuite extends ExplainSuiteHelper with DisableAdaptiveExecutionSuite | |
} | ||
} | ||
|
||
test("SPARK-33850: explain formatted - check presence of subquery in case of AQE") { | ||
withTable("df1") { | ||
withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true") { | ||
withTable("df1") { | ||
spark.range(1, 100) | ||
.write | ||
.format("parquet") | ||
.mode("overwrite") | ||
.saveAsTable("df1") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: |
||
|
||
val sqlText = "EXPLAIN FORMATTED SELECT (SELECT min(id) FROM df1) as v" | ||
val expected_pattern1 = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: we don't the number in the name, I think. |
||
"Subquery:1 Hosting operator id = 2 Hosting Expression = Subquery subquery#x" | ||
|
||
withNormalizedExplain(sqlText) { normalizedOutput => | ||
assert(expected_pattern1.r.findAllMatchIn(normalizedOutput).length == 1) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
test("Support ExplainMode in Dataset.explain") { | ||
val df1 = Seq((1, 2), (2, 3)).toDF("k", "v1") | ||
val df2 = Seq((2, 3), (1, 1)).toDF("k", "v2") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its better to use temporary views in tests where possible.