[fix](function) support TIMESTAMPDIFF MICROSECOND in nereids#63365
Open
Mryange wants to merge 1 commit into
Open
[fix](function) support TIMESTAMPDIFF MICROSECOND in nereids#63365Mryange wants to merge 1 commit into
Mryange wants to merge 1 commit into
Conversation
Contributor
Author
|
/review |
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
There was a problem hiding this comment.
Code review completed. I did not find blocking issues.
Critical checkpoint conclusions:
- Goal and proof: The PR routes Nereids TIMESTAMPDIFF(MICROSECOND, start, end) to the existing MicroSecondsDiff scalar function, matching the intended end-minus-start argument order. The added FE unit test and regression case cover literal and aggregate DATETIMEV2(6) usage.
- Scope: The change is small and focused on binding the missing unit plus test coverage.
- Concurrency and lifecycle: No shared mutable state, locking, threads, static initialization dependency, or lifecycle-sensitive path is introduced.
- Config and compatibility: No config, storage format, FE-BE protocol, or rolling-upgrade compatibility concern is introduced. The scalar function and executable path already exist.
- Parallel paths: Existing timestampdiff units remain unchanged. The Nereids binder now covers MICROSECOND for the timestampdiff path; date add/sub/floor/ceil paths are not part of this PR.
- Error handling: Unsupported units still fail analysis; no ignored Status or exception-boundary issue is involved in this Java analyzer path.
- Tests and results: Regression output is deterministic because the new aggregate query returns one row, and the table is dropped before use. No issue found in the added expected results.
- Observability and performance: No new runtime-heavy path or observability need; binding adds only one switch case.
- User focus: No additional user-provided review focus was supplied.
Contributor
Author
|
run buildall |
Contributor
TPC-H: Total hot run time: 31005 ms |
Contributor
TPC-DS: Total hot run time: 169010 ms |
Contributor
Author
|
run buildall |
Contributor
TPC-H: Total hot run time: 30607 ms |
Contributor
TPC-DS: Total hot run time: 169141 ms |
Contributor
FE Regression Coverage ReportIncrement line coverage |
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 problem does this PR solve?
Nereids rejects
TIMESTAMPDIFF(MICROSECOND, ...)during analysis.The executable path already exists through
MicroSecondsDiff, but the FE binder cannot reach it because:Interval.TimeUnitdoes not define a standaloneMICROSECONDDatetimeFunctionBinderonly routesTIMESTAMPDIFFup toSECONDAs a result, queries such as
TIMESTAMPDIFF(MICROSECOND, MIN(t), MAX(t))fail even for validDATETIMEV2(6)inputs.Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)