Skip to content

Add human_readable_seconds function (trino compatible)#64704

Open
xing-sudo wants to merge 1 commit into
apache:masterfrom
xing-sudo:feature/human_readable_seconds
Open

Add human_readable_seconds function (trino compatible)#64704
xing-sudo wants to merge 1 commit into
apache:masterfrom
xing-sudo:feature/human_readable_seconds

Conversation

@xing-sudo

Copy link
Copy Markdown

What problem does this PR solve?

Issue Number: This PR implements human_readable_seconds from the doris-future task list
(https://github.com/apache/doris/issues/#48203)

Problem Summary:

Add human_readable_seconds function for Trino compatibility.
Converts a double value of seconds into a human-readable string
containing weeks, days, hours, minutes, and seconds.

Example:

  • human_readable_seconds(96) → "1 minute, 36 seconds"
  • human_readable_seconds(3762) → "1 hour, 2 minutes, 42 seconds"
  • human_readable_seconds(56363463) → "93 weeks, 1 day, 8 hours, 31 minutes, 3 seconds"

Release note

Add human_readable_seconds scalar function (Trino compatible).

Check List (For Author)

  • Test

    • Regression test (to be added)
    • Unit Test (BE unit test passed: 9/9)
    • Manual test
    • No need to test
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes. (Documentation PR to be added)

@xing-sudo xing-sudo requested a review from zclllyybb as a code owner June 22, 2026 12:58
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants