Last active
August 13, 2025 06:21
-
-
Save xevix/04f33d2f2e3c79a564f1962ea2f8b520 to your computer and use it in GitHub Desktop.
List Hive Partitions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH hive_cols AS ( | |
PIVOT ( | |
SELECT | |
file.split('/').list_filter(lambda x: x.contains('=')).list_transform(lambda x: x.split('=')).unnest() AS kv, | |
file | |
FROM glob('/path/to/hive/**/*.parquet') | |
) | |
ON kv[1] | |
USING first(kv[2]) | |
) | |
FROM hive_cols; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment