Closed jeremyyeo closed 1 month ago
Thanks for reporting...liquid clustering optimization needs a rethink.
One of the issues here is that the table is created and partitioned outside of dbt. If the table's partition existed inside of dbt, the ALTER statement would not be attempted.
Describe the bug
Opening on behalf of customer.
Due to the introduction of https://github.com/databricks/dbt-databricks/blob/49b9c80492274e922b41d54abe6ae5eb3888e047/dbt/include/databricks/macros/relations/liquid_clustering.sql#L24 in 1.8 - this broke some customers runs of tables that they had created outside of dbt.
Steps To Reproduce
No schema yaml file.
^ After the
merge
, we try toALTER ... CLUSTER BY NONE
which causes the error.Back on 1.7 - we didn't attempt to do that and therefore no errors:
Expected behavior
Perhaps not error when customers upgrade from 1.7 > 1.8 (Versionless in dbt Cloud) by not sending the
ALTER ... CLUSTER BY NONE
query if the table has a partition (even if the partition was not declared in a schema yaml filepartition_by
config?).Screenshots and log output
As above.
System information
The output of
dbt --version
:The operating system you're using: macOS
The output of
python --version
: 3.11.9Additional context
Additionally, the customer mentioned that it would be useful to have had some documentation that:
^ I don't really know where this would go personally but I guess it wasn't too clear that this was happening if you just read release notes here: https://github.com/databricks/dbt-databricks/releases/tag/v1.8.2
One would have to deep dive into the actual code changes.