rshkv commented on code in PR #12301:
URL: https://github.com/apache/iceberg/pull/12301#discussion_r1958818328
##########
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:
Yeah, let's follow the common definition of an extension being "the bit
after the last dot" (e.g.,
[commons-io](https://github.com/apache/commons-io/blob/4988e4b0697f6b6bdead3f3465c1e3c16fe2e33f/src/main/java/org/apache/commons/io/FilenameUtils.java#L629-L630)).
I think my test cases with `parquet` as filename were silly. Removed those
--
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]