Repository navigation
Conversation
…ty/ClickHouse into data_lake_clustering_read
…9.2-with-panic-safe-ffi) Co-authored-by: Cursor <cursoragent@cursor.com>
…9.2-with-panic-safe-ffi)
…ty/ClickHouse into data_lake_clustering_read
|
This PR is dependent on changes to delta-kernel-rs |
Audit Report: Altinity/ClickHouse PR #2395PR: Altinity/ClickHouse#2395 — Read clustering columns from delta lake and use it for data skipping AI audit note: This review comment was generated by AI (claude-opus-4.6). ScopeThis PR adds support for reading Delta Lake liquid clustering columns from domain metadata ( Files changed
Call GraphTransition Matrix
Confirmed DefectsMedium: Clustering columns not invalidated on credential-rotation snapshot rebuild
Code evidence ( // Line 760: kernel_snapshot_state is reset, but clustering_columns is NOT
kernel_snapshot_state.reset();
initOrUpdateSnapshot();
snapshot_stats = getSnapshotStatsImpl();
// clustering_columns still holds old value hereCode evidence ( void TableSnapshot::initOrUpdateClusteringColumns() const
{
if (clustering_columns.has_value()) // <-- returns early with stale data
return;
// ...
}Medium:
|
…ty/ClickHouse into data_lake_clustering_read
|
AI audit note: This review comment was generated by AI (claude-4.6-opus). Audit update for PR Altinity/ClickHouse#2395 (Delta Lake liquid-clustering predicate fallback): Scope
Call GraphConfirmed defects:Low: Trivial
Coverage summary:
Additional observations (not defects):
|
|
TESTING |
|
@subkanthi pls do not forget to add the corresponding labels (port-antalya in particular) |
|
|
||
| addSettingsChanges(settings_changes_history, "26.6", | ||
| { | ||
| {"delta_lake_clustering_predicate_fallback", false, true, "New setting to enable clustering-aware predicate fallback for Delta Lake tables with Liquid Clustering."}, |
There was a problem hiding this comment.
Must be only in Antalya section above.
| return schema->physical_names_map; | ||
| } | ||
|
|
||
| const DB::Names & TableSnapshot::getClusteringColumns() const |
There was a problem hiding this comment.
I did not find where is this method called. Is it used, or just dead code?
There was a problem hiding this comment.
yes this function is not used, removed.
|
|
||
| if (!result) | ||
| { | ||
| LOG_TRACE(log, "No delta.clustering domain metadata found — table is not liquid-clustered"); |
There was a problem hiding this comment.
I think make sense to add a table name in message.
There was a problem hiding this comment.
TableSnapshot does not store the table name, but added the table location. IKernelHelper::getTableLocation()
| logical_columns = std::move(physical_columns); | ||
| } | ||
|
|
||
| LOG_TRACE(log, "Clustering columns: {}", fmt::join(logical_columns, ", ")); |
There was a problem hiding this comment.
Make sense to add table name here too.
There was a problem hiding this comment.
Same here added IKernelHelper::getTableLocation()
|
|
||
| auto arr = obj->getArray("clusteringColumns"); | ||
| if (!arr) | ||
| throw DB::Exception(DB::ErrorCodes::BAD_ARGUMENTS, "delta.clustering: missing clusteringColumns array"); |
There was a problem hiding this comment.
I thing BAD_ARGUMENTS is incorrect code here. It is used for arguments in queries, when here is some metadata incosistency.
There was a problem hiding this comment.
Replaced with INCORRECT_DATA error code.
| { | ||
| throw DB::Exception( | ||
| DB::ErrorCodes::BAD_ARGUMENTS, | ||
| "Failed to parse delta.clustering domain metadata: {}", e.displayText()); |
There was a problem hiding this comment.
The same as above about error code.
And what is going on when this exception thrown? Does customer have an opinion to execute query in old way?
There was a problem hiding this comment.
Replaced with INCORRECT_DATA error code.
| } | ||
|
|
||
| void TableSnapshot::initOrUpdateClusteringColumns() const | ||
| { |
There was a problem hiding this comment.
As I understand this method called in any case, but clustering_columns is used only when delta_lake_clustering_predicate_fallback=1. Make sense to check this setting here to avoid useless snapshot parsing when feature is turned off.
There was a problem hiding this comment.
Added logic to run initOrUpdateClusteringColumns only if delta_lake_clustering_predicate_fallback is set.
const bool need_clustering_columns = filter_dag
&& settings[DB::Setting::delta_lake_enable_engine_predicate]
&& settings[DB::Setting::delta_lake_clustering_predicate_fallback];
if (need_clustering_columns)
initOrUpdateClusteringColumns();
…ty/ClickHouse into data_lake_clustering_read
closes: ##2394
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Read clustering columns from
delta-kernel-rsand use that for data skipping.CI/CD Options
Exclude tests:
Regression jobs to run: