Dynamic retrieve the partition information

226 views
Skip to first unread message

Jiwei Cao

unread,
Jun 30, 2021, 5:33:59 PM6/30/21
to Delta Lake Users and Developers
Hi ALL:
    Is there any API to retrieve the partition columns for the delta lake table? Assue I just know the location is the delta lake table, and I can read the table and wants to figure out what is the partition columns.

--


Jiwei Cao

Sr. Machine Learning Engineer

Outreach

Follow me on LinkedIn


See how top sales organizations are improving pipeline velocity.

Chris Hoshino-Fish

unread,
Jun 30, 2021, 5:55:28 PM6/30/21
to Jiwei Cao, Delta Lake Users and Developers
Hi Jiwei,

For Delta (and most spark tables), you can get partition information using DESCRIBE TABLE: https://docs.databricks.com/spark/latest/spark-sql/language-manual/sql-ref-syntax-aux-describe-table.html#examples
This should work for Spark use-cases.

-Chris

--
You received this message because you are subscribed to the Google Groups "Delta Lake Users and Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to delta-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/delta-users/CAGg%2BfX79tL1in4jjdGj_G8HguaHdiiLmWD6xE4OzXT4P7tWQ7A%40mail.gmail.com.


--

Chris Hoshino-Fish

Sr. Solutions Architect

Databricks Inc.

fi...@databricks.com

(415) 610-8520
Pronouns: He/Him/His

Shixiong(Ryan) Zhu

unread,
Jun 30, 2021, 5:59:28 PM6/30/21
to Chris Hoshino-Fish, Jiwei Cao, Delta Lake Users and Developers
DESCRIBE DETAIL command returns the basic table information, including the partition columns: https://docs.delta.io/latest/delta-utility.html#retrieve-delta-table-details

Best Regards,

Ryan


Reply all
Reply to author
Forward
0 new messages