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
HIVE-25268: Restore the functionality of date_format UDF #2409
Conversation
@zabetak @jcamachor @sankarh Please review the change in the APIs |
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateFormat.java
Outdated
Show resolved
Hide resolved
ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFDateFormat.java
Show resolved
Hide resolved
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateFormat.java
Show resolved
Hide resolved
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateFormat.java
Outdated
Show resolved
Hide resolved
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateFormat.java
Outdated
Show resolved
Hide resolved
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateFormat.java
Outdated
Show resolved
Hide resolved
2584095
to
5ff5d0f
Compare
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateFormat.java
Outdated
Show resolved
Hide resolved
select date_format('1800-01-14 01:01:10.123', 'yyyy-MM-dd HH:mm:ss.SSS z'); | ||
|
||
set hive.local.time.zone=Africa/Johannesburg; | ||
select date_format('1400-01-14 01:01:10.123', 'yyyy-MM-dd HH:mm:ss.SSS z'); |
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.
Do we have tests for other formats (to ensure DateTimeFormat doesn't break anything)? Also need update of wiki doc.
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.
All the existing tests with SimpleDateFormat Formatter is passing except the milliseconds change which I have mentioned in my 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.
Once this patch is merged I will update the Hive wiki as well
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 to @sankarh comments. Existing test cases are fine. Could please add some more time zone based test cases.
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.
done
6c5d98b
to
a3f7007
Compare
Rebased on latest master |
…1900 if the local timezone is other than UTC (Nikhil Gupta, reviewed by Ashish Sharma, Stamatis Zampetakis, Sankar Hariappan) Signed-off-by: Sankar Hariappan <sankarh@apache.org> Closes (apache#2409)
What changes were proposed in this pull request?
Use new java time APIs to get the result instead of older APIs to restore functionality
Why are the changes needed?
date_format UDF gives
These changes fix both of the above issues
Does this PR introduce any user-facing change?
The functionality is restored for the date_format UDF
How was this patch tested?