[SPARK-29652][SQL] AlterTable/DescribeTable should not list the table as a child #26318
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 were proposed in this pull request?
remove the
tablefromAlterTable/DescribeTable.children.Why are the changes needed?
For DDL/DML commands, we only want to get the v2 table from
DataSourceV2Relation. Things can go wrong if other rules transform the query plan and mistakenly convertDataSourceV2Relationin DDL/DML commands to something else.As discussed in #26091 , we should exclude the
tablefromAlterTable/DescribeTable.children, so that they can't be transformed unintentionally. This is also what we did for the writing plans (AppendData for example).The code is mostly extracted from #25955 , to ease the review of that PR. All credits go to @rdblue
Does this PR introduce any user-facing change?
no
How was this patch tested?
existing tests