Skip to content

Fix datediff function #1208

Merged
imay merged 8 commits intoapache:masterfrom
HangyuanLiu:fix-datediff
May 28, 2019
Merged

Fix datediff function #1208
imay merged 8 commits intoapache:masterfrom
HangyuanLiu:fix-datediff

Conversation

@HangyuanLiu
Copy link
Copy Markdown
Contributor

Fix the datediff function to compatible with MySQL function logic
The DATEDIFF function only uses the date part for calculations and ignores the time part

Copy link
Copy Markdown
Contributor

@imay imay left a comment

Choose a reason for hiding this comment

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

Add some unit test for this bug?

return new IntLiteral(datediff, Type.INT);
String[] parsePatterns = { "yyyyMMdd" };
try {
//DATEDIFF function only uses the date part for calculations and ignores the time part
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.

Suggested change
//DATEDIFF function only uses the date part for calculations and ignores the time part
// DATEDIFF function only uses the date part for calculations and ignores the time part

Copy link
Copy Markdown
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

LGTM

@imay imay merged commit f648bdd into apache:master May 28, 2019
luwei16 pushed a commit to luwei16/Doris that referenced this pull request Apr 7, 2023
…ion (apache#1208)

Co-authored-by: airborne12 <airborne12@gmail.com>
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.

3 participants