morrySnow commented on code in PR #1856: URL: https://github.com/apache/doris-website/pull/1856#discussion_r1920135733
########## docs/sql-manual/sql-functions/scalar-functions/date-time-functions/date-ceil.md: ########## @@ -24,83 +24,83 @@ specific language governing permissions and limitations under the License. --> -## date_ceil -### Description -**Syntax** +## Description -`DATETIME DATE_CEIL(DATETIME datetime, INTERVAL period type)` +`date_ceil` rounds a given date to the next upper boundary of the specified time interval. +## Syntax -Convert the date to the nearest rounding up time of the specified time interval period. +`DATE_CEIL(DATETIME datetime, INTERVAL period type)` -The datetime parameter is a valid date expression. +## Parameters -The period parameter specifies how many units each cycle consists of, starting from 0001-01-01T00:00:00 +| Parameter | Description | +| -- | -- | +| `datetime` | The argument is a valid date expression | +| `period` | The argument specifies how many units make up each period, with the start time being 0001-01-01T00:00:00 | +| `type` | The argument can be: YEAR, MONTH, DAY, HOUR, MINUTE, SECOND| -Type: YEAR, MONTH, DAY, HOUR, MINUTE, SECOND. +## Return Value -### Example +The return value is a date or time, representing the result of rounding the input value up to the specified unit. +## Examples + +```sql +select date_ceil("2023-07-13 22:28:18",interval 5 second); ``` -mysql [(none)]>select date_ceil("2023-07-13 22:28:18",interval 5 second); +```text +--------------------------------------------------------------+ | second_ceil('2023-07-13 22:28:18', 5, '0001-01-01 00:00:00') | +--------------------------------------------------------------+ | 2023-07-13 22:28:20 | +--------------------------------------------------------------+ -1 row in set (0.01 sec) - -mysql [(none)]>select date_ceil("2023-07-13 22:28:18",interval 5 minute); +``` +```sql +select date_ceil("2023-07-13 22:28:18",interval 5 minute); +--------------------------------------------------------------+ | minute_ceil('2023-07-13 22:28:18', 5, '0001-01-01 00:00:00') | +--------------------------------------------------------------+ | 2023-07-13 22:30:00 | +--------------------------------------------------------------+ -1 row in set (0.01 sec) - -mysql [(none)]>select date_ceil("2023-07-13 22:28:18",interval 5 hour); +``` +```sql +select date_ceil("2023-07-13 22:28:18",interval 5 hour); +``` +```text +------------------------------------------------------------+ | hour_ceil('2023-07-13 22:28:18', 5, '0001-01-01 00:00:00') | +------------------------------------------------------------+ | 2023-07-13 23:00:00 | +------------------------------------------------------------+ -1 row in set (0.01 sec) - -mysql [(none)]>select date_ceil("2023-07-13 22:28:18",interval 5 day); +``` +```sql +select date_ceil("2023-07-13 22:28:18",interval 5 day); +``` +```text +-----------------------------------------------------------+ | day_ceil('2023-07-13 22:28:18', 5, '0001-01-01 00:00:00') | +-----------------------------------------------------------+ | 2023-07-15 00:00:00 | +-----------------------------------------------------------+ -1 row in set (0.00 sec) - -mysql [(none)]>select date_ceil("2023-07-13 22:28:18",interval 5 month); +``` +```sql +select date_ceil("2023-07-13 22:28:18",interval 5 month); +``` +```text +-------------------------------------------------------------+ | month_ceil('2023-07-13 22:28:18', 5, '0001-01-01 00:00:00') | +-------------------------------------------------------------+ | 2023-12-01 00:00:00 | +-------------------------------------------------------------+ -1 row in set (0.01 sec) - -mysql [(none)]>select date_ceil("2023-07-13 22:28:18",interval 5 year); +``` +```sql Review Comment: block 之间最好加个空行,防止渲染错误 ########## docs/sql-manual/sql-functions/scalar-functions/date-time-functions/date-ceil.md: ########## @@ -24,83 +24,83 @@ specific language governing permissions and limitations under the License. --> -## date_ceil -### Description -**Syntax** +## Description -`DATETIME DATE_CEIL(DATETIME datetime, INTERVAL period type)` +`date_ceil` rounds a given date to the next upper boundary of the specified time interval. +## Syntax -Convert the date to the nearest rounding up time of the specified time interval period. +`DATE_CEIL(DATETIME datetime, INTERVAL period type)` Review Comment: 1. 参数不需要类型 2. 参数需要用尖括号包裹 ```suggestion `DATE_CEIL(<datetime>, INTERVAL <period> <type>)` ``` ########## docs/sql-manual/sql-functions/scalar-functions/date-time-functions/extract.md: ########## @@ -24,31 +24,41 @@ specific language governing permissions and limitations under the License. --> -## extract -### description -#### Syntax +## Description -`INT extract(unit FROM DATETIME)` +The `extract` function is used to extract a specified part of a date or time value, such as the year, month, day, hour, minute, second, etc. This function is commonly used to extract specific time components from a datetime field for calculation, comparison, or display. -Extract DATETIME The value of a specified unit. The unit can be year, day, hour, minute, second or microsecond +## Syntax -### Example +`EXTRACT(unit FROM DATETIME)` +## Parameters + +| Parameter | Description | +| -- | -- | +| `unit` | The unit to extract from the DATETIME. Possible values are year, month, day, hour, minute, second, or microsecond | +| `from` | Fixed syntax | +| `period` | The argument is a valid date expression | Review Comment: 参数中没有 period ########## docs/sql-manual/sql-functions/scalar-functions/date-time-functions/extract.md: ########## @@ -24,31 +24,41 @@ specific language governing permissions and limitations under the License. --> -## extract -### description -#### Syntax +## Description -`INT extract(unit FROM DATETIME)` +The `extract` function is used to extract a specified part of a date or time value, such as the year, month, day, hour, minute, second, etc. This function is commonly used to extract specific time components from a datetime field for calculation, comparison, or display. -Extract DATETIME The value of a specified unit. The unit can be year, day, hour, minute, second or microsecond +## Syntax -### Example +`EXTRACT(unit FROM DATETIME)` +## Parameters + +| Parameter | Description | +| -- | -- | +| `unit` | The unit to extract from the DATETIME. Possible values are year, month, day, hour, minute, second, or microsecond | +| `from` | Fixed syntax | Review Comment: 固定的token不用当做参数 -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org