rdblue commented on code in PR #9008:
URL: https://github.com/apache/iceberg/pull/9008#discussion_r1558267994


##########
api/src/main/java/org/apache/iceberg/transforms/Timestamps.java:
##########
@@ -89,17 +153,21 @@ public SerializableFunction<Long, Integer> bind(Type type) 
{
 
   @Override
   public boolean canTransform(Type type) {
-    return type.typeId() == Type.TypeID.TIMESTAMP;
+    return type.typeId() == Type.TypeID.TIMESTAMP || type.typeId() == 
Type.TypeID.TIMESTAMP_NANO;
   }
 
   @Override
   public Type getResultType(Type sourceType) {
-    if (granularity == ChronoUnit.DAYS) {
+    if (apply.resultTypeUnit == ChronoUnit.DAYS) {
       return Types.DateType.get();
     }
     return Types.IntegerType.get();
   }
 
+  public ChronoUnit getResultTypeUnit() {

Review Comment:
   Is it possible to avoid exposing `ChronoUnit`?
   
   Also, Iceberg method names should almost never use `get`. Either use a more 
specific verb or omit `get` because it doesn't add anything.



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to