Repository navigation
Allow multi-component identifiers in TimeSeries tables - #112799
Conversation
|
Workflow [PR], commit [ba1dadc] Summary: ✅
AI ReviewSummaryThis PR broadens Findings❌ Blockers
Final Verdict❌ Changes required before merge. |
There was a problem hiding this comment.
Pull request overview
This PR broadens TimeSeries identifier support to allow multi-component IDs (e.g. Tuple(UInt64, UInt64)), updating type validation and moving the per-query tag mapping (timeSeriesStoreTags / timeSeriesIdTo*) to work with arbitrary comparable identifier columns. It also updates user-facing docs and adds an integration test for tuple IDs.
Changes:
- Allow
TimeSeriesidcolumns to be any comparable non-Nullable type, with automatic ID expression selection only for the legacy set (UInt64,UInt128,UUID,FixedString(16)). - Rework
ContextTimeSeriesTagsCollectorand time-series SQL functions to accept identifier columns instead of a small fixed set of ID C++ types. - Add integration coverage for tuple identifiers and update engine documentation.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/integration/test_prometheus_protocols/test_different_table_engines.py | Adds integration test creating TimeSeries tables with Tuple(UInt64, UInt64) identifiers. |
| src/Storages/TimeSeries/TimeSeriesIDGenerator.cpp | Improves error reporting when auto-selecting an ID generator is not possible for the chosen id type. |
| src/Storages/TimeSeries/normalizeTimeSeriesDefinition.cpp | Expands id type validation from a fixed allowlist to “comparable non-Nullable”. |
| src/Storages/StorageTimeSeries.cpp | Updates in-source engine documentation to describe broader allowed id types and defaulting behavior. |
| src/Interpreters/ContextTimeSeriesTagsCollector.h | Changes collector API to work with identifier columns; documents serialized-ID storage approach. |
| src/Interpreters/ContextTimeSeriesTagsCollector.cpp | Implements serialized-ID keying for storing/looking up tags by arbitrary identifier columns (incl. Nullable skipping for storeTags). |
| src/Functions/TimeSeries/TimeSeriesTagsFunctionHelpers.h | Adjusts ID argument validation API to no longer return a specific ID C++ type. |
| src/Functions/TimeSeries/TimeSeriesTagsFunctionHelpers.cpp | Updates ID type validation to accept any comparable non-Nullable type (optionally wrapped in Nullable). |
| src/Functions/TimeSeries/timeSeriesStoreTags.cpp | Uses column-based storage into the per-query collector (supports nullable IDs by skipping NULL rows). |
| src/Functions/TimeSeries/timeSeriesIdToTags.cpp | Switches to column-based lookup in the per-query collector. |
| src/Functions/TimeSeries/timeSeriesIdToGroup.cpp | Switches to column-based lookup in the per-query collector. |
| docs/en/engines/table-engines/integrations/time-series.md | Updates public docs to describe broader allowed id types and default generator selection constraints. |
|
@vitlibar what's the default one? The 64-bit hash is not enough, we need 128bit. |
I switched the default id type to |
4e58a1e to
042b11a
Compare
042b11a to
ba1dadc
Compare
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 191/228 (83.77%) · Uncovered code |
d7972dc
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Allow multi-component identifiers in TimeSeries tables.
For example, the following command will create a table with two-component identifier:
Version info
26.8.1.694(included in26.8and later)