Allow timestamp-index derived columns in star-tree dimensionsSplitOrder validation#18774
Conversation
…er validation Timestamp-index derived columns ($col$GRANULARITY) declared via fieldConfig timestampConfig granularities are materialized as dictionary-encoded single-value TIMESTAMP columns at segment generation time, so they are absent from the schema during table config validation. TableConfigUtils #validateStarTreeIndexConfigs rejected them with 'Failed to find dimension column ... in schema', forcing users to bypass validation via the raw REST API. Accept declared timestamp-index columns in dimensionsSplitOrder without a schema lookup, mirroring how they are handled at segment generation time. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #18774 +/- ##
=========================================
Coverage 64.78% 64.78%
Complexity 1309 1309
=========================================
Files 3380 3380
Lines 209544 209561 +17
Branches 32797 32802 +5
=========================================
+ Hits 135746 135758 +12
- Misses 62870 62875 +5
Partials 10928 10928
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Walked through the three guards in |
Problem
A table config that references timestamp-index derived columns (
\$<column>\$<GRANULARITY>, e.g.\$OrderDate\$DAY) instarTreeIndexConfigs[].dimensionsSplitOrderis rejected byTableConfigUtilsvalidation with:These derived columns are declared via
fieldConfigList[].timestampConfig.granularitiesand are materialized as dictionary-encoded, single-valueTIMESTAMPcolumns at segment generation time (TimestampIndexUtils#applyTimestampIndex). They are therefore absent from the schema during config validation, even though the configuration is valid and works at runtime. Today the only workaround is to push the config through the REST API with validation skipped.Fix
validateStarTreeIndexConfigsnow receives the set of declared timestamp-index columns (TimestampIndexUtils#extractColumnsWithGranularity) and accepts them indimensionsSplitOrderwithout a schema lookup — matching how they are handled at segment generation time. Columns whose granularity is not declared intimestampConfigare still rejected.Testing
Added
TableConfigUtilsTest#testValidateStarTreeIndexWithTimestampIndexDerivedColumns:\$OrderDate\$DAY/WEEK/MONTHwith matchingtimestampConfiggranularities now validates.\$OrderDate\$HOUR) still fails validation.checkstyle:checkandlicense:checkpass onpinot-segment-local.