-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-28471][SQL][DOC][FOLLOWUP] Fix year patterns in the comments of date-time expressions #25796
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
Conversation
| * See [https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html]. | ||
| * Note that hive Language Manual says it returns 0 if fail, but in fact it returns null. | ||
| * If the second parameter is missing, use "yyyy-MM-dd HH:mm:ss". | ||
| * If the second parameter is missing, use "uuuu-MM-dd HH:mm:ss". |
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.
|
|
||
| /** | ||
| * The formatter parses/formats timestamps according to the pattern `yyyy-MM-dd HH:mm:ss.[..fff..]` | ||
| * The formatter parses/formats timestamps according to the pattern `uuuu-MM-dd HH:mm:ss.[..fff..]` |
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.
ISO_LOCAL_DATE (
spark/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeFormatterHelper.scala
Line 90 in 60be6d2
| .append(DateTimeFormatter.ISO_LOCAL_DATE) |
uuuu
| * @param dateExpr A date, timestamp or string. If a string, the data must be in a format that | ||
| * can be cast to a timestamp, such as `yyyy-MM-dd` or `yyyy-MM-dd HH:mm:ss.SSSS` | ||
| * @param format A pattern `dd.MM.yyyy` would return a string like `18.03.1993` | ||
| * can be cast to a timestamp, such as `uuuu-MM-dd` or `uuuu-MM-dd HH:mm:ss.SSSS` |
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 uses TimestampFormatter which can output negative years using the uuuu pattern.
|
Test build #110621 has finished for PR 25796 at commit
|
dongjoon-hyun
left a comment
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.
+1, LGTM. Thank you, @MaxGekk .
Merged to master.
What changes were proposed in this pull request?
In the PR, I propose to fix comments of date-time expressions, and replace the
yyyypattern byuuuuwhen the implementation supposes the former one.Why are the changes needed?
To make comments consistent to implementations.
Does this PR introduce any user-facing change?
No
How was this patch tested?
By running Scala Style checker.