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


##########
api/src/main/java/org/apache/iceberg/expressions/Expressions.java:
##########
@@ -74,37 +73,32 @@ public static Expression not(Expression child) {
 
   @SuppressWarnings("unchecked")
   public static <T> UnboundTerm<T> bucket(String name, int numBuckets) {
-    Transform<?, T> transform =
-        (Transform<?, T>) Transforms.bucket(Types.StringType.get(), 
numBuckets);
+    Transform<?, T> transform = (Transform<?, T>) 
Transforms.bucket(numBuckets);
     return new UnboundTransform<>(ref(name), transform);
   }
 
   @SuppressWarnings("unchecked")
   public static <T> UnboundTerm<T> year(String name) {
-    return new UnboundTransform<>(
-        ref(name), (Transform<?, T>) 
Transforms.year(Types.TimestampType.withZone()));
+    return new UnboundTransform<>(ref(name), (Transform<?, T>) 
Transforms.year());
   }
 
   @SuppressWarnings("unchecked")
   public static <T> UnboundTerm<T> month(String name) {
-    return new UnboundTransform<>(
-        ref(name), (Transform<?, T>) 
Transforms.month(Types.TimestampType.withZone()));
+    return new UnboundTransform<>(ref(name), (Transform<?, T>) 
Transforms.month());
   }
 
   @SuppressWarnings("unchecked")
   public static <T> UnboundTerm<T> day(String name) {
-    return new UnboundTransform<>(
-        ref(name), (Transform<?, T>) 
Transforms.day(Types.TimestampType.withZone()));
+    return new UnboundTransform<>(ref(name), (Transform<?, T>) 
Transforms.day());
   }
 
   @SuppressWarnings("unchecked")
   public static <T> UnboundTerm<T> hour(String name) {
-    return new UnboundTransform<>(
-        ref(name), (Transform<?, T>) 
Transforms.hour(Types.TimestampType.withZone()));
+    return new UnboundTransform<>(ref(name), (Transform<?, T>) 
Transforms.hour());
   }
 
   public static <T> UnboundTerm<T> truncate(String name, int width) {
-    return new UnboundTransform<>(ref(name), 
Transforms.truncate(Types.LongType.get(), width));
+    return new UnboundTransform<>(ref(name), Transforms.truncate(width));

Review Comment:
   This is one of the places where the old API was awkward. Expressions with 
transforms needed to guess the source type before the expression was bound.



-- 
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]

Reply via email to