jcamachor commented on a change in pull request #764: HIVE-22170
URL: https://github.com/apache/hive/pull/764#discussion_r324409305
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFToUnixTimeStamp.java
##########
@@ -117,6 +121,19 @@ protected void initializeInput(ObjectInspector[]
arguments) throws UDFArgumentEx
+ " takes only string/date/timestamp/timestampwltz types. Got
Type:" + arg1OI
.getPrimitiveCategory().name());
}
+
+ if (timeZone == null) {
+ timeZone = SessionState.get().getConf().getLocalTimeZone();
+ formatter.setTimeZone(TimeZone.getTimeZone(timeZone));
+ }
+ }
+
+ public void configure(MapredContext context) {
Review comment:
No, this is the comment of the super method that it overrides (I added the
override notation since it was missing):
```
/**
* Additionally setup GenericUDF with MapredContext before initializing.
* This is only called in runtime of MapRedTask.
*
* @param context context
*/
```
Basically this is needed because we need to set up the timezone from the
configuration when we are about to execute the udf in each of the nodes, but we
only have access to the configuration object through this context. This is
called before calling the initialize method.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]