-
Notifications
You must be signed in to change notification settings - Fork 1k
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] Support 'show partitions' sql #2521
Conversation
@@ -237,4 +237,36 @@ public void testNonnull() { | |||
spark.sql("DROP TABLE IF EXISTS S"); | |||
} | |||
} | |||
|
|||
@Test | |||
public void testShowPartitionsPartitioned() { |
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.
Maybe put these in a new test class named ShowCommandTest
which will contain case related to SHOW
commands.
case t @ ShowPartitions(PaimonRelation(table), specOpt, _) if t.resolved => | ||
PaimonShowTablePartitionsCommand( | ||
table, | ||
specOpt.map(s => s.asInstanceOf[ResolvedPartitionSpec])) |
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.
try this, maybe it can work too:
import org.apache.spark.sql.execution.datasources.v2.DataSourceV2Implicits._
specOpt.asResolvedPartitionSpecs
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.
asResolvedPartitionSpecs
This is useful for Seq[PartitionSpec]
.
+1 for nice catch. |
Thanks @XuQianJin-Stars , merging... |
Purpose
fix 'show partitions' sql's bug
Tests
PaimonPartitionManagementTest
API and Format
Documentation