RussellSpitzer commented on code in PR #15778:
URL: https://github.com/apache/iceberg/pull/15778#discussion_r3033515173
##########
spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/actions/SparkZOrderUDF.java:
##########
@@ -180,6 +186,29 @@ value, inputBuffer(position,
ZOrderByteUtils.PRIMITIVE_BUFFER_SIZE))
return udf;
}
+ private UserDefinedFunction timestampNtzToOrderedBytesUDF() {
+ int position = inputCol;
+ UserDefinedFunction udf =
+ functions
+ .udf(
+ (LocalDateTime value) -> {
+ if (value == null) {
+ return PRIMITIVE_EMPTY;
+ }
+ long micros =
ChronoUnit.MICROS.between(TIMESTAMP_NTZ_LOCAL_EPOCH, value);
Review Comment:
```suggestion
long micros = DateTimeUtil.microsFromTimestamp(value);
```
We have a helper for this :)
--
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]