-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: Support legacy date formatter for Spark date_format function #15535
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2020,9 +2020,6 @@ Expected<std::shared_ptr<DateTimeFormatter>> buildSimpleDateTimeFormatter( | |
| case 'D': | ||
| builder.appendDayOfYear(count); | ||
| break; | ||
| case 'u': | ||
| builder.appendDayOfWeek1Based(count); | ||
| break; | ||
| case 'E': | ||
| builder.appendDayOfWeekText(count); | ||
| break; | ||
|
|
@@ -2057,6 +2054,9 @@ Expected<std::shared_ptr<DateTimeFormatter>> buildSimpleDateTimeFormatter( | |
| case 'S': | ||
| builder.appendFractionOfSecond(count); | ||
| break; | ||
| case 'u': | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure why this function is in functions/lib, looks like this function is only used in Spark. CC @rui-mo And this behavior is not supported in Presto because it always uses joda time.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The historical reasons are unclear, it may be for the purpose of centralizing all formatters.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Hi @NEUpanning, do you have any input on this? I only found #10354 but it doesn’t explain why the simple formatter cannot be Spark-specific.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought formatters which could be reused should in |
||
| builder.appendDayOfWeek1Based(count); | ||
| break; | ||
| case 'w': | ||
| builder.appendWeekOfWeekYear(count); | ||
| break; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep alphabetical order
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't move it, they are all appendDayOfWeekxxx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't removed, it was just moved to the bottom.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it placed here because the next is appendDayOfWeekText, both way can be acceptable, integrate with appendDayOfWeekxxx or alphabetical order