-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SPARK-33514][SQL] Migrate TRUNCATE TABLE command to use UnresolvedTable to resolve the identifier #30457
Conversation
Kubernetes integration test starting |
Kubernetes integration test status success |
Test build #131485 has finished for PR 30457 at commit
|
Kubernetes integration test starting |
Kubernetes integration test status success |
Test build #131489 has finished for PR 30457 at commit
|
cc @cloud-fan (GA passed) |
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.
LGTM, please fix conflicts.
Kubernetes integration test starting |
Kubernetes integration test status failure |
Test build #131562 has finished for PR 30457 at commit
|
Test build #131563 has finished for PR 30457 at commit
|
Test build #131589 has finished for PR 30457 at commit
|
thanks, merging to master! |
* | ||
* For example: | ||
* {{{ | ||
* TRUNCATE TABLE multi_part_name [PARTITION (partcol1=val1, partcol2=val2 ...)] | ||
* }}} | ||
*/ | ||
override def visitTruncateTable(ctx: TruncateTableContext): LogicalPlan = withOrigin(ctx) { | ||
TruncateTableStatement( |
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.
shouldn't we remove TruncateTableStatement?
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.
Thanks for the catch! Created a follow up PR: #30811
…se class ### What changes were proposed in this pull request? This PR removes unused `TruncateTableStatement`: #30457 (comment) ### Why are the changes needed? To remove unused `TruncateTableStatement` from #30457. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Not needed. Closes #30811 from imback82/remove_truncate_table_stmt. Authored-by: Terry Kim <yuminkim@gmail.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
…se class This PR removes unused `TruncateTableStatement`: #30457 (comment) To remove unused `TruncateTableStatement` from #30457. No Not needed. Closes #30811 from imback82/remove_truncate_table_stmt. Authored-by: Terry Kim <yuminkim@gmail.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit e7e29fd) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
What changes were proposed in this pull request?
This PR proposes to migrate
TRUNCATE TABLE
to useUnresolvedTable
to resolve the table identifier. This allows consistent resolution rules (temp view first, etc.) to be applied for both v1/v2 commands. More info about the consistent resolution rule proposal can be found in JIRA or proposal doc.Note that
TRUNCATE TABLE
works only with v1 tables, and not supported for v2 tables.Why are the changes needed?
The changes allow consistent resolution behavior when resolving the table identifier. For example, the following is the current behavior:
With this PR,
TRUNCATE TABLE
above fails with the following:, which is expected since temporary view is resolved first and
TRUNCATE TABLE
doesn't support a temporary view.Does this PR introduce any user-facing change?
After this PR,
TRUNCATE TABLE
is resolved to a temp viewt
instead of tabledb.t
in the above scenario.How was this patch tested?
Updated existing tests.