Commit 3aa7ade
authored
fix: snapshot was producing empty summary (#1767)
## Which issue does this PR close?
- Closes #. There was no open issue for this. I noticed this while
trying out iceberg-rust.
## What changes are included in this PR?
The first line in the method `SnapshotProducer::write_added_manifest`
(`let added_data_files = std::mem::take(&mut self.added_data_files);`)
sets the `self.added_data_files` to an empty vec.
`SnapshotProducer::write_added_manifest` is called via the call chain
`SnapshotProducer::commit` -> `SnapshotProducer::manifest_file` ->
`SnapshotProducer::write_added_manifest`). Hence, if
`SnapshotProducer::summary` is called after calling
`SnapshotProducer::manifest_file`, the summary produced was empty due to
empty `self.added_data_files`.
This PR rearranges the code in `SnapshotProducer::commit` to make sure
the produced summary is not empty.
## Are these changes tested?
No new tests have been added for this as there were no previous tests.1 parent b3b5afe commit 3aa7ade
1 file changed
+13
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | 383 | | |
393 | | - | |
| 384 | + | |
394 | 385 | | |
395 | 386 | | |
396 | 387 | | |
| |||
408 | 399 | | |
409 | 400 | | |
410 | 401 | | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
411 | 414 | | |
412 | 415 | | |
413 | 416 | | |
| |||
0 commit comments