HaoXuAI opened a new pull request, #17219: URL: https://github.com/apache/iceberg/pull/17219
### What Adds `SnapshotParser.fromJson(InputFile)`, which streams the `snapshots` array of a table metadata JSON document and yields one `Snapshot` at a time instead of materializing the whole list. ### Why `TableMetadataParser` parses the entire document into memory and builds every `Snapshot` in the `snapshots` array. For tables with very large snapshot histories this dominates heap usage even when a consumer only needs to walk snapshots (e.g. by id, timestamp, or manifest-list location). The streaming reader keeps a single snapshot in memory at a time. ### Notes - The returned `CloseableIterable` opens a fresh stream on each iteration and must be closed by the caller. - Returns an empty iterable when the document has no `snapshots` array. - No spec or public-type changes; reuses the existing snapshot parsing. ### Testing - Adds `TestSnapshotStreamParser` covering ordering, snapshot-field fidelity, re-iteration, and the missing/empty `snapshots` array cases. -- 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]
