deniskuzZ commented on code in PR #5792:
URL: https://github.com/apache/hive/pull/5792#discussion_r2098240180
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergFilterFactory.java:
##########
@@ -228,6 +228,32 @@ private static Object convertLiteral(Object literal,
TransformSpec transform) {
}
}
+ public static Object convertPartitionLiteral(Object literal, TransformSpec
transform) {
Review Comment:
````
private static Object convertLiteral(Object literal, TransformSpec
transform) {
if (transform == null) {
return literal;
}
try {
switch (transform.getTransformType()) {
case YEAR:
case MONTH:
case DAY:
case HOUR:
return convertTimeLiteral(literal));
case TRUNCATE:
return
Transforms.truncate(transform.getTransformParam().get()).bind(Types.StringType.get())
.apply(literal.toString());
case BUCKET:
return
Transforms.bucket(transform.getTransformParam().get()).bind(Types.StringType.get())
.apply(literal.toString());
case IDENTITY:
return literal;
default:
throw new UnsupportedOperationException("Unknown transform: " +
transform.getTransformType());
}
} catch (NumberFormatException | DateTimeException |
IllegalStateException e) {
throw new RuntimeException(
String.format("Unable to parse value '%s' as '%s' transform
value", literal.toString(), transform));
}
}
````
--
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]