RussellSpitzer commented on code in PR #12301: URL: https://github.com/apache/iceberg/pull/12301#discussion_r1958699822
########## api/src/main/java/org/apache/iceberg/FileFormat.java: ########## @@ -60,9 +60,10 @@ public String addExtension(String filename) { public static FileFormat fromFileName(CharSequence filename) { for (FileFormat format : VALUES) { int extStart = filename.length() - format.ext.length(); - if (Comparators.charSequences() - .compare(format.ext, filename.subSequence(extStart, filename.length())) - == 0) { + if (extStart > 0 Review Comment: Do we want to fail if the file name is just an extension? I think this is a reasonable choice because the only weird case I can imagine is setting your file name to metadata.json. All the other extensions are pretty much useless without another part to the name. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org