Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the document of TO_DATE, TO_DAYS, year_floor, WEEKS_ADD, WEEKS_DIFF, WEEKS_SUB function #2197

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

DongLiang-0
Copy link
Contributor

@DongLiang-0 DongLiang-0 commented Mar 17, 2025

Versions

  • dev
  • 3.0
  • 2.1
  • 2.0

Languages

  • Chinese
  • English

Docs Checklist

  • Checked by AI
  • Test Cases Built

Comment on lines 36 to 37
## Required parameter
**datetime_value**: datetime type datetime
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function doc's parameter should put into a table.


The difference between the start time and the end time is weeks
```sql
WEEKS_DIFF([<end_date> | <end_datetime>], [<start_date> | <start_datetime>])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
WEEKS_DIFF([<end_date> | <end_datetime>], [<start_date> | <start_datetime>])
WEEKS_DIFF(<end_date> <start_date>)


### example
## Optional parameters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Optional parameters
## Parameters

Comment on lines 39 to 42
| **`end_date`** | `DATE` | Later date |
| **`end_datetime`** | `DATETIME` | Later datetime |
| **`start_date`** | `DATE` | Earlier date |
| **`start_datetime`** | `DATETIME` | Earlier datetime |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在这里解释一下可以处理 date / datetime 就可以了

## Description
## Syntax
```sql
WEEKS_SUB([<date_value> | <datetime_value>], <week_period>)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
WEEKS_SUB([<date_value> | <datetime_value>], <week_period>)
WEEKS_SUB(<date_value>, <week_period>)

Comment on lines 34 to 44
## Required parameters
**<week_period>**
> Integer representing the number of weeks to be reduced (positive number means reduction, negative number means increase).

The parameter date can be DATETIME or DATE, and the return type is consistent with that of the parameter date.
## Optional parameters
- **<date_value>**
> Date input value of type `DATE`

### example
- **<datetime_value>**
> Date and time input value of type `DATETIME`

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用表格


`DATETIME WEEKS_SUB(DATETIME date, INT weeks)`
## Description
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

缺少函数描述

- period: specifies how many years each cycle consists of.
- origin: starting from 0001-01-01T00:00:00.
```sql
YEAR_FLOOR([<datetime_value> | <date_value>]) |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

datetime 和 date 就用一个参数表示就可以,在参数说明章节,说清楚可以是date 或者 datetime 就好了

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