-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[SPARK-48660][SQL] Fix explain result for CreateTableAsSelect #51013
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
Open
yuexing
wants to merge
6
commits into
apache:master
Choose a base branch
from
yuexing:SPARK-48660
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0925a7f
SPARK-48660 fix explain result for CreateTableAsSelect
yuexing 2f12c3e
SPARK-48660 fix explain result for CreateTableAsSelect
yuexing 6ee4ff4
[SPARK-48660][SQL]fix explain result for CreateDataSourceTableAsSelec…
yuexing 7af5054
SPARK-48660 [SQL]fix explain result for CreateDataSourceTableAsSelect…
yuexing b1a9127
SPARK-48660 [SQL]fix explain result for CreateDataSourceTableAsSelect…
yuexing d443587
[SPARK-48660][SQL]fix explain result for CreateDataSourceTableAsSelec…
yuexing File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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.
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.
From the cases provided by @wangyum , I believe there are two more critical issues here:
Optimized Logical Plan
contains redundantSubqueryAlias
nodes.Physical Plan
contains redundantSubqueryAlias
andRelation
nodes.Therefore, in the test cases, I think we should primarily focus on making assertion checks for these issues.
In addition, I have printed out the result of
explainOutput
.It seems that the second issue I described has been fixed, but the
SubqueryAlias
nodes still exist in theOptimized Logical Plan
. Could you take a further look into this? @yuexing@wangyum Is my description accurate? If there's anything incorrect, please help me correct it.
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.
ok, I see. Let me also do a innerChildren fix in the Command class, which is the logic plan.
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.
now the output is:
== Optimized Logical Plan ==
CreateDataSourceTableAsSelectCommand
spark_catalog
.default
.target_table
, ErrorIfExists, Project [id#16, name#17], [id, name]+- Project [id#16, name#17]
+- Filter (id#16 > 0)
+- Relation spark_catalog.default.source_table[id#16,name#17] parquet, Statistics(sizeInBytes=0.0 B)
== Physical Plan ==
Execute CreateDataSourceTableAsSelectCommand CreateDataSourceTableAsSelectCommand
spark_catalog
.default
.target_table
, ErrorIfExists, Project [id#16, name#17], [id, name]+- *(1) Filter (isnotnull(id#16) AND (id#16 > 0))
+- *(1) ColumnarToRow
+- FileScan parquet spark_catalog.default.source_table[id#16,name#17] Batched: true, DataFilters: [isnotnull(id#16), (id#16 > 0)], Format: Parquet, Location: InMemoryFileIndex(1 paths)[file:/Users/yuexing/playground/spark/sql/core/spark-warehouse/org.apac..., PartitionFilters: [], PushedFilters: [IsNotNull(id), GreaterThan(id,0)], ReadSchema: structid:int,name:string