-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Allow partial date parsing when simple datetime formatter is used #11386
Allow partial date parsing when simple datetime formatter is used #11386
Conversation
✅ Deploy Preview for meta-velox canceled.
|
@rui-mo Could you please take a look? Thanks! |
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.
Thanks.
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.
Thanks.
@pedroerp Could you please take a look? Thanks! |
@mbasmanova Could you please take a look? Thanks! |
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.
@NEUpanning Thank you for the change. I assume this is a change in user-visible behavior. Would you update the docs?
e3f74e6
to
4b2e9aa
Compare
@mbasmanova Thank you for your quick feedback. This change impacts the behavior of |
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.
@NEUpanning Thank you for iterating. Looks great.
@@ -337,3 +325,33 @@ These functions support TIMESTAMP and DATE input types. | |||
part of the 53rd week of year 2004, so the result is 2004. Only supports DATE type. | |||
|
|||
SELECT year_of_week('2005-01-02'); -- 2004 | |||
|
|||
Different Behaviors Between Simple And Joda Date Formmaters | |||
-------------------------------- |
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.
I think --- needs to go all the way to cover the length of the title.
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.
Thanks. Fixed
@@ -337,3 +325,33 @@ These functions support TIMESTAMP and DATE input types. | |||
part of the 53rd week of year 2004, so the result is 2004. Only supports DATE type. | |||
|
|||
SELECT year_of_week('2005-01-02'); -- 2004 | |||
|
|||
Different Behaviors Between Simple And Joda Date Formmaters |
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.
nit: Simple vs. Joda Date Formatter
-------------------------------- | ||
|
||
To align with Spark, Velox supports both `Simple <https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html>`_ | ||
and `Joda <https://www.joda.org/joda-time/>`_ date formmater to parse/format timestamp/date strings |
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.
formmater -> formmaters
|
||
To align with Spark, Velox supports both `Simple <https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html>`_ | ||
and `Joda <https://www.joda.org/joda-time/>`_ date formmater to parse/format timestamp/date strings | ||
on the functions `from_unixtime`, `unix_timestamp`, `make_date` and `to_unix_timestamp`. |
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.
on the functions -> used in functions
for functions, use references
:spark:func:`from_unixtime`
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.
Thanks. Fixed
@Yuhta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Conbench analyzed the 1 benchmark run on commit There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
The Spark legacy datetime formatter allows parsing date from incomplete text,
seeing code link. This PR enables partial date parsing when the
LENIENT_SIMPLE
or
STRICT_SIMPLE
datetime formatter is used.Relates issues: #10354, gluten#6227