[SPARK-57847][SQL] Support the TIME data type in approx_count_distinct_for_intervals#56934
Open
yadavay-amzn wants to merge 2 commits into
Open
[SPARK-57847][SQL] Support the TIME data type in approx_count_distinct_for_intervals#56934yadavay-amzn wants to merge 2 commits into
yadavay-amzn wants to merge 2 commits into
Conversation
…nt_distinct_for_intervals test
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.
What changes were proposed in this pull request?
Adds
TimeTypeto the input types accepted by theapprox_count_distinct_for_intervalsaggregate. TIME values are bucketed by their internal nanosecond-of-dayLongrepresentation, routed through the sameLong -> Doublepath already used forTimestampType/DayTimeIntervalType.Why are the changes needed?
approx_count_distinct_for_intervalsaccepts numeric/date/timestamp/interval endpoints but rejected TIME at analysis time. TIME has a natural numeric (nanosecond-of-day) ordering, so it can be bucketed like the other temporal types.Does this PR introduce any user-facing change?
Yes -
approx_count_distinct_for_intervalsnow accepts TIME columns and endpoints.How was this patch tested?
Extended
ApproxCountDistinctForIntervalsSuitewith TIME endpoints asserting the per-interval approximate distinct counts; the error-message expectations were updated to include TIME.Was this patch authored or co-authored using generative AI tooling?
Authored with assistance by Claude Opus 4.8.