Skip to content

Add today alias for current_date#8423

Merged
Dandandan merged 6 commits intoapache:mainfrom
smallzhongfeng:add-today
Dec 12, 2023
Merged

Add today alias for current_date#8423
Dandandan merged 6 commits intoapache:mainfrom
smallzhongfeng:add-today

Conversation

@smallzhongfeng
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot added the logical-expr Logical plan and expressions label Dec 5, 2023
Copy link
Copy Markdown
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

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

Thanks @smallzhongfeng for this PR
Please add also tests and user documentation scalar_functions.md

@alamb alamb changed the title Add another name for current_date Add today alias for current_date Dec 5, 2023
@smallzhongfeng
Copy link
Copy Markdown
Contributor Author

smallzhongfeng commented Dec 6, 2023

Thanks @smallzhongfeng for this PR Please add also tests and user documentation scalar_functions.md

Thanks. Updated.

@comphead
Copy link
Copy Markdown
Contributor

comphead commented Dec 6, 2023

Thanks @smallzhongfeng for this PR Please add also tests and user documentation scalar_functions.md

Thanks. Updated.

Please add today to the function list as well, see date_trunc, datetrunc as an example.

Also the tests are needed, we can likely use timestamps.slt sqllogic file as the test location

@github-actions github-actions Bot added the sqllogictest SQL Logic Tests (.slt) label Dec 6, 2023
@smallzhongfeng
Copy link
Copy Markdown
Contributor Author

I add a test, because the function today is real-time, I can only compare it with the function now.

true

query B
select now() = current_date();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you add it for today as well?

Copy link
Copy Markdown
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @smallzhongfeng

@comphead
Copy link
Copy Markdown
Contributor

comphead commented Dec 6, 2023

Thanks @smallzhongfeng
Please add today to the function list in the doc, like in https://github.com/apache/arrow-datafusion/blob/9be75f71eb59a359674669f5c2688f49f44b4050/docs/source/user-guide/sql/scalar_functions.md?plain=1#L1282

Comment thread datafusion/sqllogictest/test_files/timestamps.slt
Copy link
Copy Markdown
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you again @smallzhongfeng -- this looks great

Comment thread datafusion/sqllogictest/test_files/timestamps.slt Outdated
Co-authored-by: Alex Huang <huangweijun1001@gmail.com>
@Dandandan Dandandan merged commit 1154274 into apache:main Dec 12, 2023
@Dandandan
Copy link
Copy Markdown
Contributor

Thank you @Weijun-H

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

Labels

logical-expr Logical plan and expressions sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants