zhangbutao commented on code in PR #4507:
URL: https://github.com/apache/hive/pull/4507#discussion_r1271664630
##########
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.getDays()));
+ };
+ break;
+
default:
throw new UDFArgumentException(
" ICEBERG_BUCKET() only takes
STRING/CHAR/VARCHAR/BINARY/INT/LONG/DECIMAL/FLOAT/DOUBLE" +
Review Comment:
Shoud we add `DATE ` type in the UDFArgumentException message?
--
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]