kokila-19 commented on code in PR #6819:
URL: https://github.com/apache/hive/pull/6819#discussion_r4129830869
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/udf/GenericUDFIcebergZorder.java:
##########
@@ -151,15 +152,16 @@ private byte[] convertToOrderedBytes(Object value,
PrimitiveObjectInspector oi,
case TIMESTAMP:
Object tsValue = oi.getPrimitiveJavaObject(value);
- long tsInMillis;
+ long tsInMicros;
if (tsValue instanceof org.apache.hadoop.hive.common.type.Timestamp
ts) {
- tsInMillis = ts.toEpochMilli();
+ tsInMicros = ts.toEpochSecond() * 1_000_000L + (ts.getNanos() /
1000);
} else if (tsValue instanceof java.sql.Timestamp ts) {
- tsInMillis = ts.getTime();
+ Instant instant = ts.toInstant();
+ tsInMicros = instant.getEpochSecond() * 1_000_000L +
(instant.getNano() / 1000);
Review Comment:
Either this can be kept or use iceberg's conversion.
**DateTimeUtil.microsFromInstant(ts.toInstant());**
--
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]