A request for Databricks cluster key optimization #4824
Closed
tshen-PayPay
started this conversation in
General
Replies: 1 comment
-
This is out of scope for SQLGlot, but you can implement a custom transformation if you want. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Due to Databricks’ liquid clustering key constraints (see [Databricks documentation](https://docs.databricks.com/aws/en/delta/clustering)), the index is only effective when no functions are applied on the processed_at column. For example, consider the following SQL:
Since applying any operators on processed_at prevents the liquid clustering key index from being effective, we need a functionality that optimizes the query when converting it to Databricks SQL. The optimized version rewrites the condition as follows:
This rewritten SQL avoids wrapping processed_at with any functions, thus ensuring that the liquid clustering key index can be utilized effectively.
Beta Was this translation helpful? Give feedback.
All reactions