You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "murali-db (via GitHub)" <gi...@apache.org> on 2025/11/12 01:03:15 UTC
[I] [Core] RESTFileScanTaskParser.fromJson crashes on empty delete-file-references array [iceberg]
murali-db opened a new issue, #14564:
URL: https://github.com/apache/iceberg/issues/14564
### Apache Iceberg version
1.10.0 (latest release)
### Query engine
None
### Please describe the bug 🐞
## Bug Description
`RESTFileScanTaskParser.fromJson()` throws `NoSuchElementException` when parsing responses with empty `delete-file-references` arrays.
## Location
`core/src/main/java/org/apache/iceberg/rest/RESTFileScanTaskParser.java:90`
## Root Cause
```java
if (jsonNode.has(DELETE_FILE_REFERENCES)) {
List<Integer> indices = JsonUtil.getIntegerList(DELETE_FILE_REFERENCES, jsonNode);
Preconditions.checkArgument(
Collections.max(indices) < allDeleteFiles.size(), // ← LINE 90: Crashes if indices is empty
"Invalid delete file references: %s, expected indices < %s",
indices,
allDeleteFiles.size());
```
`Collections.max() throws NoSuchElementException when called on an empty list.`
## Reproduction
1. Use Iceberg REST catalog with server-side scan planning
2. Create a table with data files but no delete files
3. Call plan table scan endpoint
4. Server returns valid JSON with "delete-file-references": []
5. Parser crashes with NoSuchElementException
## Expected Behavior
Empty delete-file-references arrays should be valid (no delete files to reference).
If confirmed as an issue, I can contribute a bug fix for this.
### 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] [Core] RESTFileScanTaskParser.fromJson crashes on empty delete-file-references array [iceberg]
Posted by "murali-db (via GitHub)" <gi...@apache.org>.
murali-db closed issue #14564: [Core] RESTFileScanTaskParser.fromJson crashes on empty delete-file-references array
URL: https://github.com/apache/iceberg/issues/14564
--
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] (created in error, ignore) [iceberg]
Posted by "murali-db (via GitHub)" <gi...@apache.org>.
murali-db closed issue #14564: (created in error, ignore)
URL: https://github.com/apache/iceberg/issues/14564
--
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