Repository navigation
Commit c3ef346
authored
feat: preserve bitmap-backed Parquet row selections (#25731)
## Which issue does this PR close?
- Closes #23883.
- Closes #24488.
- Follows up on #24186 using the row-group-local scan path merged in
#25608.
## Rationale for this change
An external index can supply a bitmap-backed Parquet row selection, but
splitting a file-level selection into row groups or intersecting it with
selector-backed page pruning still converts it to selectors. Keeping the
bitmap avoids materializing fragmented selector runs and lets pruning
use a bitwise intersection.
## What changes are included in this PR?
- Split bitmap-backed file selections using bitmap slices, preserving
partial-group masks and recognizing fully selected or skipped groups.
Keep the existing single-pass selector path.
- Promote incoming selectors to a bitmap when intersecting with an
existing bitmap-backed selection.
- Use Parquet's `RowSelection::total_row_count()` directly instead of
introducing the temporary `row_selection_len` helper from #24186.
- Add regression coverage for bitmap preservation and external
selections when a dynamic predicate changes between row groups.
Consolidate opener test imports at module scope.
The deprecated `into_overall_row_selection` implementation is unchanged.
Preparation and reverse scans use the local selections introduced by
#25608. Runtime pruning remains disabled for scans with selections.
## What is the testing strategy for this PR?
Unit tests cover selector/bitmap intersections, empty intersections,
file-length validation, non-byte-aligned bitmap slicing, and
preservation through preparation and reversal. Integration tests cover
bitmap selections spanning row groups and statistics pruning.
The dynamic-pruning regression covers both selector and bitmap external
selections, with an unselected control scan that verifies runtime
pruning occurs. Temporarily removing the selection guard makes the test
fail because rebuilding with `None` returns unselected rows; the guard
was restored after this check.
Passed targeted tests:
- `cargo test -p datafusion-datasource-parquet --lib access_plan::test
--offline` (26 tests)
- `cargo test -p datafusion-datasource-parquet --lib opener::test
--offline` (56 tests)
- `cargo test -p datafusion --test parquet_integration
external_access_plan --offline` (16 tests)
Pre-submission checks passed: `cargo fmt --all`, `cargo clippy
--all-targets --all-features -- -D warnings`, and the checks in `uv run
./dev/rust_lint.sh`. The final HTML documentation check was rerun
successfully with `uv run ./ci/scripts/check_docs_html.sh` after
installing its missing `cargo-depgraph` prerequisite.
## Are there any user-facing changes?
No public API or selected-row changes. Bitmap-backed external selections
retain their representation through splitting and intersection rather
than being converted to selectors.1 parent 76f9fde commit c3ef346
3 files changed
Lines changed: 446 additions & 98 deletions
File tree
- datafusion
- core/tests/parquet
- datasource-parquet/src
- opener
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
197 | 196 | | |
198 | 197 | | |
199 | 198 | | |
200 | | - | |
201 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
202 | 239 | | |
203 | 240 | | |
204 | 241 | | |
205 | 242 | | |
206 | | - | |
207 | 243 | | |
208 | 244 | | |
209 | 245 | | |
210 | 246 | | |
211 | | - | |
| 247 | + | |
212 | 248 | | |
213 | 249 | | |
214 | 250 | | |
215 | 251 | | |
216 | 252 | | |
217 | | - | |
218 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
219 | 269 | | |
220 | 270 | | |
221 | 271 | | |
| |||
316 | 366 | | |
317 | 367 | | |
318 | 368 | | |
319 | | - | |
320 | | - | |
321 | | - | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
322 | 372 | | |
323 | 373 | | |
324 | 374 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
297 | 298 | | |
298 | 299 | | |
299 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
300 | 349 | | |
301 | 350 | | |
302 | 351 | | |
| |||
392 | 441 | | |
393 | 442 | | |
394 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
395 | 460 | | |
396 | 461 | | |
397 | 462 | | |
| |||
838 | 903 | | |
839 | 904 | | |
840 | 905 | | |
| 906 | + | |
841 | 907 | | |
842 | 908 | | |
843 | 909 | | |
| |||
862 | 928 | | |
863 | 929 | | |
864 | 930 | | |
865 | | - | |
| 931 | + | |
866 | 932 | | |
867 | 933 | | |
868 | 934 | | |
| |||
986 | 1052 | | |
987 | 1053 | | |
988 | 1054 | | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
989 | 1159 | | |
990 | 1160 | | |
991 | 1161 | | |
| |||
1022 | 1192 | | |
1023 | 1193 | | |
1024 | 1194 | | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
1038 | 1215 | | |
1039 | 1216 | | |
1040 | 1217 | | |
| |||
0 commit comments