xhxaidi commented on issue #18505:
URL: https://github.com/apache/iceberg/issues/18505#issuecomment-6175296181
Fair question. A spec-compliant server shouldn't send -1, so this isn't a
correctness issue, it's about failing clearly when a server sends a malformed
response.
The parser already guards the upper bound (indices >= size get "Invalid
delete file references..."), which is also only hit by a buggy server. Without
the lower bound, a negative index slips past that check and surfaces as an
`IndexOutOfBoundsException` from `List.get`, which doesn't point at the
response at all.
One plausible way it happens: a server builds the references with something
like `deleteFiles`.`indexOf`(file), and a missing entry turns into -1. Our own
serializer guards against the equivalent case (index != null in
`TableScanResponseParser`), but other implementations might not, and the spec
doesn't set minimum: 0 on the field.
That said, it's a small robustness fix, so happy to close it if you don't
think it's worth the extra check.
--
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]