ayushtkn commented on code in PR #5134:
URL: https://github.com/apache/hive/pull/5134#discussion_r1530203854


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/udf/GenericUDFIcebergMonth.java:
##########
@@ -97,7 +97,7 @@ public ObjectInspector initialize(ObjectInspector[] 
arguments) throws UDFArgumen
         Function<Object, Integer> timestampLocalTzTransform = 
Transforms.month().bind(Types.TimestampType.withZone());
         evaluator = arg -> {
           TimestampLocalTZWritable val = (TimestampLocalTZWritable) 
converter.convert(arg.get());
-          result.set(timestampLocalTzTransform.apply(val.getNanos() / 1000L));
+          result.set(timestampLocalTzTransform.apply(val.getSeconds() * 1e6 + 
val.getNanos() / 1000L));

Review Comment:
   this same logic is used multiple places, can explore extracting into a util 
to get microseconds 



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to