Skip to content

Conversation

@AngersZhuuuu
Copy link
Contributor

What changes were proposed in this pull request?

Add SHOW PARTITIONS as table-valued function 'show_partitions'
In origin, we can't directly analysis partition metadata information in SQL, we need export it out and then analysis on it.
Now, we can just use SQL to do this.

Analysis such as which partition is lost? how many partitions in a partition value range etc

Why are the changes needed?

Make it convenient for user to analysis metadata

Does this PR introduce any user-facing change?

User can use show_partitions table-valued function such as .

sql("CREATE TABLE t(id INT) PARTITIONED BY (part STRING)")
sql("INSERT OVERWRITE TABLE t PARTITION (part = '1') SELECT 1")
sql("INSERT OVERWRITE TABLE t PARTITION (part = '2') SELECT 2")
sql("SELECT * FROM show_partitions('t')").show()

+---------+
|partition|
+---------+
|   part=1|
|   part=2|
+---------+

How was this patch tested?

added UT

@github-actions github-actions bot added the SQL label Feb 7, 2021
@SparkQA
Copy link

SparkQA commented Feb 7, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39568/

@SparkQA
Copy link

SparkQA commented Feb 7, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39568/

@SparkQA
Copy link

SparkQA commented Feb 7, 2021

Test build #134985 has finished for PR 31505 at commit 15f162e.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do other DBMSs support this as a built-in show_columns function? If then, could you update the PR description by adding those references?

@AngersZhuuuu
Copy link
Contributor Author

Do other DBMSs support this as a built-in show_columns function? If then, could you update the PR description by adding those references?

after a long time search, no other DBMS support this kind of functions. But it's really helpful for data analysis user to have a better insight for metadata.

@github-actions
Copy link

github-actions bot commented Jun 9, 2021

We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!

@github-actions github-actions bot added the Stale label Jun 9, 2021
@github-actions github-actions bot closed this Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants