rdblue commented on a change in pull request #91: Ignore unsupported partition
fields
URL: https://github.com/apache/incubator-iceberg/pull/91#discussion_r256979597
##########
File path: api/src/main/java/com/netflix/iceberg/transforms/Transforms.java
##########
@@ -56,12 +58,27 @@ private Transforms() {
if (transform.equalsIgnoreCase("identity")) {
return Identity.get(type);
} else if (type.typeId() == Type.TypeID.TIMESTAMP) {
- return Timestamps.valueOf(transform.toUpperCase(Locale.ENGLISH));
+ return match(
+ () -> Timestamps.valueOf(transform.toUpperCase(Locale.ENGLISH)),
+ () -> new UnknownTransform<>(type, transform)
+ );
} else if (type.typeId() == Type.TypeID.DATE) {
- return Dates.valueOf(transform.toUpperCase(Locale.ENGLISH));
+ return match(
+ () -> Dates.valueOf(transform.toUpperCase(Locale.ENGLISH)),
+ () -> new UnknownTransform<>(type, transform)
+ );
}
- throw new IllegalArgumentException("Unknown transform: " + transform);
+ return new UnknownTransform<>(type, transform);
+ }
+
+ private static Transform<?,?> match(Supplier<Transform> transformSupplier,
Review comment:
Nit: arguments should start at the same column or should be wrapped starting
at 4 spaces from `private`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]