Skip to content

Instantly share code, notes, and snippets.

@xevix
Last active August 13, 2025 06:21
Show Gist options
  • Save xevix/04f33d2f2e3c79a564f1962ea2f8b520 to your computer and use it in GitHub Desktop.
Save xevix/04f33d2f2e3c79a564f1962ea2f8b520 to your computer and use it in GitHub Desktop.
List Hive Partitions
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