Reject bucketed legacy epoch TimeFieldSpec values#18978
Open
Vamsi-klu wants to merge 1 commit into
Open
Conversation
Vamsi-klu
marked this pull request as ready for review
July 11, 2026 23:38
Contributor
Author
|
Review request: @npawar @Jackie-Jiang GitHub did not allow this account/integration to add requested reviewers through the reviewer section, so I am tagging the relevant reviewers here for visibility. This PR fixes #6240 by rejecting legacy Drafted-by: Codex (GPT-5); human-reviewed by Vamsi-klu before posting |
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.
Fixes #6240
What changed
This PR rejects legacy
TimeFieldSpecdefinitions that use epoch time with a bucket size greater than one.The validation is added in
SchemaUtils.validateTimeFieldSpec(...), which is the schema-validation boundary used when Pinot validates table schemas. ATimeFieldSpecwithTimeFormat.EPOCHremains valid when thetimeUnitSizeis1, but values such as5:MINUTESor any other bucketed epoch granularity are rejected with guidance to useDateTimeFieldSpecfor bucketed epoch values.The change intentionally stays at validation time rather than changing low-level
TimeGranularitySpecconstruction. That keeps object creation and legacy parsing behavior intact while preventing invalid legacy time-field schemas from being accepted.Why it matters
TimeFieldSpecis the legacy time-column representation. Allowing bucketed epoch granularities there is ambiguous and can lead to schemas that look valid but do not match the intended time semantics. Pinot already hasDateTimeFieldSpecfor richer date-time formats and bucketed granularities.Rejecting bucketed epoch
TimeFieldSpecvalues at schema validation makes the failure explicit and points users toward the correct schema construct.Impact
Schemas using legacy
TimeFieldSpecwith epoch unit size1continue to validate.Schemas using legacy
TimeFieldSpecwith bucketed epoch unit sizes are rejected during schema validation.Users who need bucketed epoch semantics should model those columns as
DateTimeFieldSpec.No ingestion, indexing, or query execution code paths are changed directly.
Testing
./mvnw -Dmaven.repo.local=/tmp/m2-pinot-6240 -pl pinot-segment-local -am -Dtest=SchemaUtilsTest -Dsurefire.failIfNoSpecifiedTests=false test./mvnw -Dmaven.repo.local=/tmp/m2-pinot-6240 -pl pinot-segment-local spotless:apply checkstyle:check license:checkgit diff --checkThe tests cover rejection for bucketed incoming and outgoing legacy time specs, and verify that the existing epoch unit-size-one case remains valid.
Drafted-by: Codex (GPT-5); human-reviewed by Vamsi-klu before marking ready for review