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


##########
core/src/main/java/org/apache/iceberg/puffin/PuffinReader.java:
##########
@@ -71,13 +71,10 @@ public FileMetadata fileMetadata() throws IOException {
 
       PuffinCompressionCodec footerCompression = PuffinCompressionCodec.NONE;
       for (Flag flag : decodeFlags(footer, footerStructOffset)) {
-        switch (flag) {
-          case FOOTER_PAYLOAD_COMPRESSED:
-            footerCompression = PuffinFormat.FOOTER_COMPRESSION_CODEC;
-            break;
-          default:
-            throw new IllegalStateException("Unsupported flag: " + flag);
-        }
+        footerCompression =
+            switch (flag) {
+              case FOOTER_PAYLOAD_COMPRESSED -> 
PuffinFormat.FOOTER_COMPRESSION_CODEC;

Review Comment:
   > what if a puffin reader encounters a puffin file with an unknown flag
   
   This is switch-over-enum, not switch-over-string - an unexpected value fails 
early in `PuffinReader#decodeFlags`, never reaching this switch.



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