SourabhBadhya commented on code in PR #4507:
URL: https://github.com/apache/hive/pull/4507#discussion_r1270596060


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/GenericUDFIcebergBucket.java:
##########
@@ -158,6 +159,16 @@ public ObjectInspector initialize(ObjectInspector[] 
arguments) throws UDFArgumen
         };
         break;
 
+      case DATE:
+        converter = new 
PrimitiveObjectInspectorConverter.DateConverter(argumentOI,
+          PrimitiveObjectInspectorFactory.writableDateObjectInspector);
+        Transform<Integer, Integer> dateTransform = 
Transforms.bucket(Types.DateType.get(), numBuckets);
+        evaluator = arg -> {
+          DateWritableV2 val = (DateWritableV2) converter.convert(arg.get());
+          result.set(dateTransform.apply(val.get().toEpochDay()));

Review Comment:
   How about `val.getDays()` instead of `val.get.toEpochDay()`?



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