steveloughran commented on code in PR #15494:
URL: https://github.com/apache/iceberg/pull/15494#discussion_r2871763055
##########
core/src/main/java/org/apache/iceberg/avro/BaseWriteBuilder.java:
##########
@@ -75,51 +75,73 @@ public ValueWriter<?> primitive(Schema primitive) {
LogicalType logicalType = primitive.getLogicalType();
if (logicalType != null) {
switch (logicalType.getName()) {
- case "date":
+ case "date" -> {
return ValueWriters.ints();
+ }
- case "time-micros":
+ case "time-micros" -> {
return ValueWriters.longs();
+ }
- case "timestamp-micros":
+ case "timestamp-micros" -> {
return ValueWriters.longs();
+ }
- case "timestamp-nanos":
+ case "timestamp-nanos" -> {
return ValueWriters.longs();
+ }
- case "decimal":
+ case "decimal" -> {
LogicalTypes.Decimal decimal = (LogicalTypes.Decimal) logicalType;
return ValueWriters.decimal(decimal.getPrecision(),
decimal.getScale());
+ }
- case "uuid":
+ case "uuid" -> {
return ValueWriters.uuids();
+ }
- default:
- throw new IllegalArgumentException("Unsupported logical type: " +
logicalType);
+ default -> throw new IllegalArgumentException("Unsupported logical
type: " + logicalType);
}
}
switch (primitive.getType()) {
- case NULL:
+ case NULL -> {
Review Comment:
so even for those one-liners the style is going to be mandatory { } blocks?
it does make the switches a lot more verbose.
--
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]