Copilot commented on code in PR #3867:
URL: https://github.com/apache/doris-website/pull/3867#discussion_r3330592406


##########
docs/sql-manual/sql-functions/scalar-functions/date-time-functions/human_readable_seconds.md:
##########
@@ -0,0 +1,116 @@
+---
+
+{
+"title": "HUMAN_READABLE_SECONDS",
+"language": "en"
+}
+
+---
+
+## Description
+
+Converts a number of seconds into a human-readable duration string using 
weeks, days, hours, minutes, and seconds.
+
+Behavior matches Presto/Trino semantics:
+
+* values are rounded to whole seconds
+* negative values use their absolute value
+* milliseconds are not emitted
+* `NaN` and `Infinity` inputs are rejected
+
+## Syntax
+
+```sql
+HUMAN_READABLE_SECONDS(<x>)
+```
+
+## Parameters
+
+| Parameter | Description                                                      
          |
+| --------- | 
-------------------------------------------------------------------------- |
+| `<x>`     | The number of seconds to format (numeric input, internally cast 
to DOUBLE) |
+
+## Return Value
+
+Returns a `VARCHAR` string representing the formatted duration.
+
+## Special Cases
+
+* When `<x>` is `NULL`, returns `NULL`
+* Fractional values are rounded to the nearest whole second
+* Negative values are converted using absolute value
+* `NaN` and `Infinity` values return an error
+
+## Examples
+
+```sql
+select human_readable_seconds(3661);
+```
+
+```text
++------------------------------+
+| human_readable_seconds(3661) |
++------------------------------+
+| 1 hour, 1 minute, 1 second   |
++------------------------------+
+```
+
+```sql
+select human_readable_seconds(475.33);
+```
+
+```text
++--------------------------------+
+| human_readable_seconds(475.33) |
++--------------------------------+
+| 7 minutes, 55 seconds          |
++--------------------------------+
+```
+
+```sql
+select human_readable_seconds(0.9);
+```
+
+```text
++-----------------------------+
+| human_readable_seconds(0.9) |
++-----------------------------+
+| 1 second                    |
++-----------------------------+
+```
+
+```sql
+select human_readable_seconds(-96);
+```
+
+```text
++------------------------------+
+| human_readable_seconds(-96)  |
++------------------------------+
+| 1 minute, 36 seconds         |
++------------------------------+
+```
+
+```sql
+select human_readable_seconds(56363463);
+```
+
+```text
++----------------------------------+
+| human_readable_seconds(56363463) |
++----------------------------------+
+| 93 weeks, 1 day, 8 hours, 31 minutes, 3 seconds |
++----------------------------------+

Review Comment:
   The ASCII table for this example is misformatted — the result row is wider 
than the header/border lines, so the rendered output is inconsistent with the 
other examples. Widen the top/bottom border and header row (and pad the header 
cell) so the column width matches the longest content row, as in the other 
example tables.



##########
docs/sql-manual/sql-functions/scalar-functions/date-time-functions/human_readable_seconds.md:
##########
@@ -0,0 +1,116 @@
+---
+
+{
+"title": "HUMAN_READABLE_SECONDS",
+"language": "en"
+}
+
+---
+
+## Description
+
+Converts a number of seconds into a human-readable duration string using 
weeks, days, hours, minutes, and seconds.
+
+Behavior matches Presto/Trino semantics:
+
+* values are rounded to whole seconds
+* negative values use their absolute value
+* milliseconds are not emitted
+* `NaN` and `Infinity` inputs are rejected

Review Comment:
   The Description states `NaN` and `Infinity` inputs are "rejected", and 
Special Cases says they "return an error". Consider documenting the exact 
behavior (e.g., the specific error/exception thrown, or whether NULL is 
returned) so users know what to expect and can handle it accordingly.



##########
docs/sql-manual/sql-functions/scalar-functions/date-time-functions/human_readable_seconds.md:
##########
@@ -0,0 +1,116 @@
+---
+
+{
+"title": "HUMAN_READABLE_SECONDS",
+"language": "en"
+}
+
+---
+
+## Description
+
+Converts a number of seconds into a human-readable duration string using 
weeks, days, hours, minutes, and seconds.
+
+Behavior matches Presto/Trino semantics:
+
+* values are rounded to whole seconds
+* negative values use their absolute value
+* milliseconds are not emitted
+* `NaN` and `Infinity` inputs are rejected
+
+## Syntax
+
+```sql
+HUMAN_READABLE_SECONDS(<x>)
+```
+
+## Parameters
+
+| Parameter | Description                                                      
          |
+| --------- | 
-------------------------------------------------------------------------- |
+| `<x>`     | The number of seconds to format (numeric input, internally cast 
to DOUBLE) |

Review Comment:
   The parameter description mentions an internal cast to `DOUBLE`, which is an 
implementation detail. Consider stating the accepted SQL types explicitly 
(e.g., DOUBLE, or any numeric type) so the contract is clear to users without 
exposing internals.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to