[Bug] truncate()
partition transformation does not work when it includes more than 100 partitions
#594
Labels
bug
Something isn't working
Is this a new bug in dbt-athena?
Current Behavior
When you use a truncate() partition transformation for a column that will result in more than 100 partitions, the batch partitioning functionality starts up and allows you to exceed 100 partitions.
However, when the query reaches out to Athena to pull in the distinct partitions, it uses truncate() in the query which is not a supported method of extracting values from a string in Athena.
Instead, it could use something like substring() to pull back the unique partial values
Expected Behavior
When I do a
truncate()
Iceberg partition transformation on a column, it is capable of handling something with greater than 100 partitions.Steps To Reproduce
Create a model with a column that when a partition transformation of truncate() is used, it will result in more than 100 partitions.
Environment
Additional Context
This is out of a Slack conversation: https://getdbt.slack.com/archives/C013MLFR7BQ/p1709755667814619
This method was referenced as where the work would need to be changed: https://github.com/dbt-athena/dbt-athena/blob/289be4f4f44f3d5a6cf575d8fe218209c4a41171/dbt/adapters/athena/impl.py#L1279
Apache Iceberg Truncate Partition documentation: https://iceberg.apache.org/spec/#truncate-transform-details
The text was updated successfully, but these errors were encountered: