You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "rshkv (via GitHub)" <gi...@apache.org> on 2025/02/17 18:46:03 UTC

[I] IndexOutOfBounds in FileFormat#fromFileName [iceberg]

rshkv opened a new issue, #12300:
URL: https://github.com/apache/iceberg/issues/12300

   ### Apache Iceberg version
   
   1.8.0 (latest release)
   
   ### Query engine
   
   None
   
   ### Please describe the bug 🐞
   
   `FileFormat#fromFileName` doesn't account for short file names [here](https://github.com/apache/iceberg/blob/bcbbd0344623ffea5b092e2de5debb0bc12892a1/api/src/main/java/org/apache/iceberg/FileFormat.java#L64). When a file name is shorter than the longest file format extension, we get an error like this one:
   ```
   begin -6, end 8, length 8
   java.lang.StringIndexOutOfBoundsException: begin -6, end 8, length 8
   	at java.base/java.lang.String.checkBoundsBeginEnd(String.java:4604)
   	at java.base/java.lang.String.substring(String.java:2707)
   	at java.base/java.lang.String.subSequence(String.java:2745)
   	at org.apache.iceberg.FileFormat.fromFileName(FileFormat.java:64)
   	at org.apache.iceberg.FileFormatTest.fromFileName(FileFormatTest.java:40)
   
   ### Willingness to contribute
   
   - [x] I can contribute a fix for this bug independently
   - [ ] I would be willing to contribute a fix for this bug with guidance from the Iceberg community
   - [ ] I cannot contribute a fix for this bug at this time


-- 
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-unsubscribe@iceberg.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] IndexOutOfBounds in FileFormat#fromFileName [iceberg]

Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra closed issue #12300: IndexOutOfBounds in FileFormat#fromFileName
URL: https://github.com/apache/iceberg/issues/12300


-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] IndexOutOfBounds in FileFormat#fromFileName [iceberg]

Posted by "rshkv (via GitHub)" <gi...@apache.org>.
rshkv commented on issue #12300:
URL: https://github.com/apache/iceberg/issues/12300#issuecomment-2665740966

   I think so, yes


-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] IndexOutOfBounds in FileFormat#fromFileName [iceberg]

Posted by "RussellSpitzer (via GitHub)" <gi...@apache.org>.
RussellSpitzer commented on issue #12300:
URL: https://github.com/apache/iceberg/issues/12300#issuecomment-2663908052

   Good catch, so I guess we need to just not do the check if the start is negative and not check in that case?


-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org