Commit ac756a4
authored
Second part of delete file read support. See
#630.
This PR provides the basis for delete file support within `ArrowReader`.
`DeleteFileManager` is introduced, in skeleton form. Full implementation
of its behaviour will be submitted in follow-up PRs.
`DeleteFileManager` is responsible for loading and parsing positional
and equality delete files from `FileIO`. Once delete files for a task
have been loaded and parsed, `ArrowReader::process_file_scan_task` uses
the resulting `DeleteFileManager` in two places:
* `DeleteFileManager::get_delete_vector_for_task` is passed a data file
path and will return an ~`Option<Vec<usize>>`~ `Option<RoaringTreeMap>`
containing the indices of all rows that are positionally deleted in that
data file (or `None` if there are none)
* `DeleteFileManager::build_delete_predicate` is invoked with the schema
from the file scan task. It will return an `Option<BoundPredicate>`
representing the filter predicate derived from all of the applicable
equality deletes being transformed into predicates, logically joined
into a single predicate and then bound to the schema (or `None` if there
are no applicable equality deletes)
This PR integrates the skeleton of the `DeleteFileManager` into
`ArrowReader::process_file_scan_task`, extending the `RowFilter` and
`RowSelection` logic to take into account any `RowFilter` that results
from equality deletes and any `RowSelection` that results from
positional deletes.
## Updates:
* refactored `DeleteFileManager` so that
`get_positional_delete_indexes_for_data_file` returns a `RoaringTreemap`
rather than a `Vec<usize>`. This was based on @liurenjie1024's
recommendation in a comment on the v1 PR, and makes a lot of sense from
a performance perspective and made it easier to implement
`ArrowReader::build_deletes_row_selection` in the follow-up PR to this
one, #951
* `DeleteFileManager` is instantiated in the `ArrowReader` constructor
rather than per-scan-task, so that delete files that apply to more than
one task don't end up getting loaded and parsed twice
## Potential further enhancements:
* Go one step further and move loading of delete files, and parsing of
positional delete files, into `ObjectCache` to ensure that loading and
parsing of the same files persists across scans
1 parent f0295f8 commit ac756a4
File tree
9 files changed
+342
-44
lines changed- crates/iceberg
- src
- arrow
- expr
9 files changed
+342
-44
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
0 commit comments