Allow timestamp-index derived columns in star-tree dimensionsSplitOrder validation#18774
Open
himanish-star wants to merge 1 commit into
Open
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:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.