Repository navigation
Add skipping_indices_types column to system.tables - #106388
Conversation
Expose the distinct, sorted set of data skipping index types defined on each table through a new `skipping_indices_types` `Array(String)` column in `system.tables`. The types are collected from `getSecondaryIndices` and deduplicated via a `std::set`, so a table with two `minmax` indices reports `minmax` once, and the result is deterministically sorted. The array is empty for tables without skip indices and for non-`MergeTree` engines. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Workflow [PR], commit [205608d] Summary: ✅
AI ReviewSummaryThis PR adds the Final Verdict
|
|
@groeneai continue with this PR: resolve review comments and fix failed tests. |
Adding the skipping_indices_types column shifted the positional column indices, but the temporary-table branch in TablesBlockSource still hardcoded src_index 21 for total_rows and 22 for total_bytes. With the new schema order those positions are storage_policy (21), total_rows (22) and total_bytes (23), so for a session temporary table the String column storage_policy received the UInt64 total_rows value and failed with "Bad get: has UInt64, requested String (BAD_GET)". Bump the two hardcoded indices to 22 and 23 to match the new order. Fixes the Fast test failures on PR ClickHouse#106388: 00693_max_block_size_system_tables_columns, 00080_show_tables_and_system_tables (both BAD_GET) and 02271_temporary_table_show_rows_bytes (wrong values). Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
@CurtizJ done. We do not have push access to your fork (maintainerCanModify only grants org members), so the fix is a one-click PR into this branch: CurtizJ#1. Root cause of Ergus's CHANGES_REQUESTED and the 3 Fast test failures is the same off-by-one: Diff (the two spots Ergus flagged, StorageSystemTables.cpp): - else if (src_index == 21 && columns_mask[src_index])
+ else if (src_index == 22 && columns_mask[src_index])
{ // total_rows
...
- else if (src_index == 22 && columns_mask[src_index])
+ else if (src_index == 23 && columns_mask[src_index])
{ // total_bytesVerified on a debug build, all four now pass (was failing): 00693_max_block_size_system_tables_columns, 00080_show_tables_and_system_tables (both were BAD_GET), 02271_temporary_table_show_rows_bytes, and 04311 (your new test). Merge CurtizJ#1 and CI will rerun. |
|
Dear @Ergus, you haven't been active on this PR for 30 days. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself. |
Fix column index in temporary-table path of system.tables
The temporary-table branch in TablesBlockSource only special-cased parameterized_view_parameters, total_rows and total_bytes; every other late column fell through to insertDefault(). So the new skipping_indices_types column at position 20 always showed [] for session temporary MergeTree tables. Add a temp-table case for it, sharing a fillSkippingIndicesTypes() helper with the non-temp path, and extend the regression test with a temporary MergeTree table. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Good catch. The temp-table branch in Fixed by adding a temp-table case for that slot, sharing a We do not have push access to this branch, so the change is a one-click PR into it: CurtizJ#2 (@ CurtizJ). Verified locally on a debug build. |
Populate skipping_indices_types for session temporary tables
|
@groeneai fix build. |
Master changed IStorage::getInMemoryMetadataPtr to return StorageMetadataHandle, whose rvalue operator StorageMetadataPtr() is deleted. The temporary-table branch passed the handle rvalue straight into fillSkippingIndicesTypes (takes const StorageMetadataPtr &), invoking the deleted conversion. Bind it to a named local first so the lvalue conversion operator is used. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
@CurtizJ Build fixed. Root cause: master changed |
Fix build: store StorageMetadataHandle in a local before conversion
…indices_types getSecondaryIndices() includes implicitly added skip indices (e.g. from add_minmax_index_for_numeric_columns) as well as explicit INDEX clauses. The column is documented as the skip-index types defined on the table, so filter out index.isImplicitlyCreated() to report only user-defined types. Matches how the create statement (IndicesDescription) omits implicit indices and how system.data_skipping_indices marks them via its creation column. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Fixed. @CurtizJ no push access to your fork, so it is a one-click merge: CurtizJ#4 (base system-tables-skip-indexes). |
Exclude implicitly created skip indices from system.tables.skipping_indices_types
|
Your PR was poisoned by the test |
|
@alexey-milovidov Branch updated: merged current master (carrying the #110260 fix for |
|
Regenerated the AUTOGENERATED block in docs/en/operations/system-tables/tables.md via utils/generate-system-tables-docs so skipping_indices_types matches the source order (before storage_policy). Moved the richer description into the StorageSystemTables.cpp column comment (source of truth the generator emits) and added the column to the SELECT * example. No push access to this fork, so contributed as one-click PR CurtizJ#6 (base system-tables-skip-indexes). Merge it and the branch updates. |
Move skipping_indices_types in the AUTOGENERATED block of docs/en/operations/system-tables/tables.md to match its source registration order (before storage_policy) by regenerating from the binary via utils/generate-system-tables-docs. Move the richer column description into the source metadata comment in StorageSystemTables.cpp so the generator emits it, and add the column to the SELECT * example. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Branch updated directly (push access via maintainer edits works now, no more one-click PRs needed):
Fork PRs CurtizJ#5 and CurtizJ#6 are obsolete and can be closed. |
|
@alexey-milovidov Closed CurtizJ#5 and #6. Thanks for taking over the branch. |
|
Branch updated: merged current master (`754b6d6433f`). The only red was Verified after the merge: the temp-table |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 32/32 (100.00%) · Uncovered code |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Added a new column
skipping_indices_typesto thesystem.tablestable. It contains the distinct types of data-skipping indices defined for each table.Version info
26.8.1.673(included in26.8and later)