Fokko commented on code in PR #7553:
URL: https://github.com/apache/iceberg/pull/7553#discussion_r1199223910
##########
spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/functions/DaysFunction.java:
##########
@@ -116,4 +119,27 @@ public Integer produceResult(InternalRow input) {
return input.isNullAt(0) ? null : invoke(input.getLong(0));
}
}
+
+ public static class TimestampNtzToDaysFunction extends BaseToDaysFunction {
+ // magic method used in codegen
+ public static int invoke(long micros) {
+ return DateTimeUtil.microsToDays(micros);
+ }
+
+ @Override
+ public DataType[] inputTypes() {
+ return new DataType[] {DataTypes.TimestampNTZType};
+ }
+
+ @Override
+ public String canonicalName() {
+ return "iceberg.days(timestamp)";
Review Comment:
Good one! I changed it to `timestamp_ntz` (since that's what Spark is also
using)
--
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]