-
Notifications
You must be signed in to change notification settings - Fork 28.7k
[SPARK-33452][SQL] Support v2 SHOW PARTITIONS #30398
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
Conversation
Kubernetes integration test starting |
Kubernetes integration test status success |
Test build #131219 has finished for PR 30398 at commit
|
Kubernetes integration test starting |
Kubernetes integration test starting |
Kubernetes integration test status failure |
Test build #131230 has finished for PR 30398 at commit
|
Kubernetes integration test status failure |
Kubernetes integration test starting |
Kubernetes integration test status failure |
Test build #131231 has finished for PR 30398 at commit
|
Test build #131234 has finished for PR 30398 at commit
|
Kubernetes integration test starting |
Test build #131277 has finished for PR 30398 at commit
|
Kubernetes integration test status failure |
Test build #131805 has finished for PR 30398 at commit
|
jenkins, retest this, please |
Test build #131834 has finished for PR 30398 at commit
|
jenkins, retest this, please |
Test build #131839 has finished for PR 30398 at commit
|
jenkins, retest this, please |
Test build #131852 has finished for PR 30398 at commit
|
jenkins, retest this, please |
Test build #131853 has finished for PR 30398 at commit
|
UnresolvedPartitionSpec(visitNonOptionalPartitionSpec(specCtx), None) | ||
} | ||
ShowPartitions( | ||
UnresolvedTableOrView(multiPart.getOrElse(Seq.empty[String])), |
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.
If it doesn't support view, why not use UnresolvedTable
?
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.
To output proper error as for V1.
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.
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.
V1:
spark/sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala
Lines 992 to 994 in 23e9920
if (table.tableType == VIEW) { | |
throw new AnalysisException(s"SHOW PARTITIONS is not allowed on a view: $tableIdentWithDB") | |
} |
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.
then we should improve the v2 error message like #30475
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.
One of purpose of this PR is to create v2 implementation compatible to v1. I would prefer to avoid changing v1 impl at least in this PR since v1 is out of the scope.
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 replaced by
UnresolvedTableOrView
byUnresolvedTable
, and - removed some checks from
CheckAnalysis.checkShowPartitions()
Test build #131900 has finished for PR 30398 at commit
|
UnresolvedPartitionSpec(visitNonOptionalPartitionSpec(specCtx), None) | ||
} | ||
ShowPartitions( | ||
UnresolvedTable(multiPart.getOrElse(Seq.empty[String]), "SHOW PARTITIONS"), |
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.
multiPart.getOrElse(Seq.empty[String])
this looks weird. How can the table name be Seq.empty
? And I don't see other parser rules doing the same thing. They are simply using visitMultipartIdentifier(ctx.multipartIdentifier)
. Why do we diverge here?
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.
fixed
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 except one comment
…ions-exec-v2 # Conflicts: # sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolvePartitionSpec.scala
GA passed, merging to master, thanks! |
Test build #131979 has finished for PR 30398 at commit
|
…r's` comments ### What changes were proposed in this pull request? The pr aims to fix the outdated `logical plan name` in `AstBuilder's` comments. ### Why are the changes needed? - After the pr #33609, the name of the logical plan below has been changed: `AlterTableAddColumns` -> `AddColumns` `AlterTableRenameColumn` -> `RenameColumn` `AlterTableAlterColumn` -> `AlterColumn` `AlterTableDropColumns` -> `DropColumns` - After the pr #30398 The name of the logical plan `ShowPartitionsStatement` has been changed to `ShowPartitions`. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Only update comments. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #47562 from panbingkun/fix_astbuilder. Lead-authored-by: panbingkun <[email protected]> Co-authored-by: panbingkun <[email protected]> Signed-off-by: yangjie01 <[email protected]>
…r's` comments ### What changes were proposed in this pull request? The pr aims to fix the outdated `logical plan name` in `AstBuilder's` comments. ### Why are the changes needed? - After the pr apache#33609, the name of the logical plan below has been changed: `AlterTableAddColumns` -> `AddColumns` `AlterTableRenameColumn` -> `RenameColumn` `AlterTableAlterColumn` -> `AlterColumn` `AlterTableDropColumns` -> `DropColumns` - After the pr apache#30398 The name of the logical plan `ShowPartitionsStatement` has been changed to `ShowPartitions`. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Only update comments. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#47562 from panbingkun/fix_astbuilder. Lead-authored-by: panbingkun <[email protected]> Co-authored-by: panbingkun <[email protected]> Signed-off-by: yangjie01 <[email protected]>
…r's` comments ### What changes were proposed in this pull request? The pr aims to fix the outdated `logical plan name` in `AstBuilder's` comments. ### Why are the changes needed? - After the pr apache#33609, the name of the logical plan below has been changed: `AlterTableAddColumns` -> `AddColumns` `AlterTableRenameColumn` -> `RenameColumn` `AlterTableAlterColumn` -> `AlterColumn` `AlterTableDropColumns` -> `DropColumns` - After the pr apache#30398 The name of the logical plan `ShowPartitionsStatement` has been changed to `ShowPartitions`. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Only update comments. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#47562 from panbingkun/fix_astbuilder. Lead-authored-by: panbingkun <[email protected]> Co-authored-by: panbingkun <[email protected]> Signed-off-by: yangjie01 <[email protected]>
…r's` comments ### What changes were proposed in this pull request? The pr aims to fix the outdated `logical plan name` in `AstBuilder's` comments. ### Why are the changes needed? - After the pr apache#33609, the name of the logical plan below has been changed: `AlterTableAddColumns` -> `AddColumns` `AlterTableRenameColumn` -> `RenameColumn` `AlterTableAlterColumn` -> `AlterColumn` `AlterTableDropColumns` -> `DropColumns` - After the pr apache#30398 The name of the logical plan `ShowPartitionsStatement` has been changed to `ShowPartitions`. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Only update comments. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#47562 from panbingkun/fix_astbuilder. Lead-authored-by: panbingkun <[email protected]> Co-authored-by: panbingkun <[email protected]> Signed-off-by: yangjie01 <[email protected]>
What changes were proposed in this pull request?
ShowPartitionsStatement
, and replace it by V2ShowPartitions
.ShowPartitionsExec
similar to V1ShowPartitionsCommand
.Why are the changes needed?
To have feature parity with Datasource V1.
Does this PR introduce any user-facing change?
Yes.
Before the change,
SHOW PARTITIONS
fails in V2 table catalogs with the exception:How was this patch tested?
By running the following test suites:
ShowPartitionsParserSuite
whereShowPartitionsStatement
is replaced by V2ShowPartitions
.v2.ShowPartitionsSuite