[Enhancement] Add human_readable_seconds function#63923
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
Hi @zclllyybb , the PR is ready for review. I addressed the previous review feedback and aligned the implementation with Presto/Trino semantics. I also added FE/BE unit tests, regression tests, and FE/BE consistency validation. Docs PR: apache/doris-website#3868 Thanks! |
|
run buildall |
|
/review |
There was a problem hiding this comment.
I found one correctness issue that should be fixed before merge. The new function is otherwise focused and well covered for normal values, nullability, constants, NaN/Inf, and FE/BE consistency around common boundaries.
Critical checkpoint conclusions:
- Goal and tests: the PR adds Presto-compatible
human_readable_seconds; normal/null/constant/folding tests are present, but out-of-range finite DOUBLE behavior is not covered. - Scope: the implementation is small and focused.
- Concurrency/lifecycle/config/transactions/persistence/data writes: not applicable; this is scalar expression evaluation only.
- Parallel code paths: FE constant folding and BE execution are both implemented, but they diverge for large finite inputs.
- Error handling: NaN/Inf are rejected, but finite values that cannot be rounded into int64 are not handled consistently.
- FE-BE protocol/type consistency: signature and return type are otherwise consistent.
- Test coverage/results: good coverage for ordinary cases; add coverage for out-of-range finite values after deciding whether to reject or clamp.
- Observability/performance: no additional observability needed; no hot-path performance concern found.
User focus: no additional user-provided review focus was specified.
f855a59 to
1c0b720
Compare
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
|
run buildall |
FE UT Coverage ReportIncrement line coverage |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
FE Regression Coverage ReportIncrement line coverage |
TPC-H: Total hot run time: 29417 ms |
TPC-DS: Total hot run time: 170743 ms |
What problem does this PR solve?
Issue Number: #48203
Related PR: #61850
Problem Summary:
It adds
human_readable_seconds(double)function with behavior aligned to Presto/Trino semantics.Example:
This PR includes:
human_readable_secondstestFoldConstBehavior matches Presto/Trino:
Release note
None
Check List (For Author)
Test
Behavior changed:
human_readable_seconds(double)scalar function.Does this need documentation?
Check List (For Reviewer who merge this PR)