kokila-19 commented on code in PR #6819:
URL: https://github.com/apache/hive/pull/6819#discussion_r4129827713
##########
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);
Review Comment:
Timestamp.java has **toEpochMicro()** method. You can directly use it.
```
public long toEpochMicro() {
return localDateTime.toEpochSecond(ZoneOffset.UTC) * 1_000_000
+ localDateTime.getNano() / 1000;
}
```
--
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]