[BUG] Trigger liquid clustering in Delta Lake integration tests [databricks]#15252
[BUG] Trigger liquid clustering in Delta Lake integration tests [databricks]#15252nartal1 wants to merge 3 commits into
Conversation
Signed-off-by: Niranjan Artal <nartal@nvidia.com>
Greptile SummaryThis PR fixes liquid-clustering tests that were checking Delta log metadata without ever triggering actual data clustering. A new
Confidence Score: 5/5Safe to merge — all OPTIMIZE calls use .collect() so failures propagate, identifier formats are consistent with the write patterns they follow, and the [databricks] tag is present in the PR title. The change is a focused, mechanical addition of OPTIMIZE calls after each write in liquid-clustering tests. The two helpers are straightforward. Every call site correctly pairs the identifier style (path-based vs. catalog name) with how the table was originally created. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[write_func / modify_table called by test framework] --> B{Table referenced by}
B -- catalog name --> C["spark.sql(OPTIMIZE table_name).collect()"]
B -- path only --> D["delta_path_identifier(path)"]
D --> E["spark.sql(OPTIMIZE delta.path).collect()"]
C --> F[Clustering physically applied to Delta files]
E --> F
F --> G[Read lambda compares GPU vs CPU results]
G --> H[assert_liquid_clustering_delta_logs_equivalent]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[write_func / modify_table called by test framework] --> B{Table referenced by}
B -- catalog name --> C["spark.sql(OPTIMIZE table_name).collect()"]
B -- path only --> D["delta_path_identifier(path)"]
D --> E["spark.sql(OPTIMIZE delta.path).collect()"]
C --> F[Clustering physically applied to Delta files]
E --> F
F --> G[Read lambda compares GPU vs CPU results]
G --> H[assert_liquid_clustering_delta_logs_equivalent]
Reviews (3): Last reviewed commit: "Merge branch 'main' of github.com:NVIDIA..." | Re-trigger Greptile |
Signed-off-by: Niranjan Artal <nartal@nvidia.com>
|
build |
2 similar comments
|
build |
|
build |
…5_liquid_clustering
|
build |
Fixes #15195.
Description
The tests in
delta_lake_liquid_clustering_test.pycreate Delta tables withCLUSTER BY, but liquid clustering is not triggered automatically. Delta performs liquid clustering only whenOPTIMIZEis run.As a result, these tests were validating writes against tables with liquid-clustering metadata without actually clustering the written data.
This PR adds a shared helper that:
OPTIMIZEafter creating or modifying each liquid-clustered table.OPTIMIZEcommand result so command failures fail the test.Other liquid-clustering test modules already run
OPTIMIZE, so no changes are required there.Validation with Apache Spark 4.0.0 and Delta Lake 4.0.0:
delta_lake_liquid_clustering_test.py::test_delta_ctas_sql_liquid_clustering: passeddelta_lake_liquid_clustering_test.py::test_delta_append_sql_liquid_clustering: passedChecklists
Documentation
Testing
(Please provide the names of the existing tests in the PR description.)
Performance