epgif commented on code in PR #9008: URL: https://github.com/apache/iceberg/pull/9008#discussion_r1629891910
########## api/src/main/java/org/apache/iceberg/transforms/Days.java: ########## @@ -55,7 +57,16 @@ public boolean satisfiesOrderOf(Transform<?, ?> other) { } if (other instanceof Timestamps) { - return Timestamps.DAY.satisfiesOrderOf(other); + Timestamps.ResultTypeUnit otherResultTypeUnit = ((Timestamps) other).resultTypeUnit(); + switch (otherResultTypeUnit) { + case MICROS: + return Timestamps.DAY_FROM_MICROS.satisfiesOrderOf(other); + case NANOS: + return Timestamps.DAY_FROM_NANOS.satisfiesOrderOf(other); + default: + throw new UnsupportedOperationException( + "Unsupported timestamp unit: " + otherResultTypeUnit); Review Comment: done ########## api/src/main/java/org/apache/iceberg/transforms/Hours.java: ########## @@ -33,16 +33,19 @@ static <T> Hours<T> get() { @Override @SuppressWarnings("unchecked") protected Transform<T, Integer> toEnum(Type type) { - if (type.typeId() == Type.TypeID.TIMESTAMP) { - return (Transform<T, Integer>) Timestamps.HOUR; + switch (type.typeId()) { + case TIMESTAMP: + return (Transform<T, Integer>) Timestamps.HOUR_FROM_MICROS; + case TIMESTAMP_NANO: + return (Transform<T, Integer>) Timestamps.HOUR_FROM_NANOS; + default: + throw new IllegalArgumentException("Unsupported type: " + type); Review Comment: done -- 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