nastra commented on code in PR #16881:
URL: https://github.com/apache/iceberg/pull/16881#discussion_r3457708553


##########
core/src/main/java/org/apache/iceberg/avro/InternalReader.java:
##########
@@ -170,65 +170,48 @@ public ValueReader<?> variant(
     public ValueReader<?> primitive(Pair<Integer, Type> partner, Schema 
primitive) {
       LogicalType logicalType = primitive.getLogicalType();
       if (logicalType != null) {
-        switch (logicalType.getName()) {
-          case "date":
-            return ValueReaders.ints();
-
-          case "time-micros":
-            return ValueReaders.longs();
-
-          case "timestamp-millis":
+        return switch (logicalType.getName()) {
+          case "date" -> ValueReaders.ints();
+          case "time-micros" -> ValueReaders.longs();
+          case "timestamp-millis" -> {
             // adjust to microseconds
             ValueReader<Long> longs = ValueReaders.longs();
-            return (ValueReader<Long>) (decoder, ignored) -> 
longs.read(decoder, null) * 1000L;

Review Comment:
   can be simplified the same way as in my other comment



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