Commit 06f7f07
authored
refactor
# Which issue does this PR close?
- Related to #8677
- part of #8159
# Rationale for this change
I am reworking how the parquet decoder's state machine works in
#8159
One of the unit tests, `test_cache_projection_excludes_nested_columns`
uses non-public APIs that I am changing
Rather than rewrite them into other non public APIs I think it would be
better if this test is in terms of public APIs
# What changes are included in this PR?
1. refactor `test_cache_projection_excludes_nested_columns` to use high
level APIs
# Are these changes tested?
They are run in CI
I also verified this test covers the intended functionality by
commenting it out:
```diff
--- a/parquet/src/arrow/async_reader/mod.rs
+++ b/parquet/src/arrow/async_reader/mod.rs
@@ -724,7 +724,9 @@ where
cache_projection.union(predicate.projection());
}
cache_projection.intersect(projection);
- self.exclude_nested_columns_from_cache(&cache_projection)
+ // TEMP don't exclude nested columns
+ //self.exclude_nested_columns_from_cache(&cache_projection)
+ Some(cache_projection)
}
/// Exclude leaves belonging to roots that span multiple parquet leaves (i.e. nested columns)
```
And then running the test:
```shell
cargo test --all-features --test arrow_reader
```
And the test fails (as expected)
```
---- predicate_cache::test_cache_projection_excludes_nested_columns stdout ----
thread 'predicate_cache::test_cache_projection_excludes_nested_columns' panicked at parquet/tests/arrow_reader/predicate_cache.rs:244:9:
assertion `left == right` failed: Expected 0 records read from cache, but got 100
left: 100
right: 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
predicate_cache::test_cache_projection_excludes_nested_columns
test result: FAILED. 88 passed; 1 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.20s
```
# Are there any user-facing changes?
No, this is only test changestest_cache_projection_excludes_nested_columns to use high level APIs (#8754)1 parent 7e54bb2 commit 06f7f07
File tree
2 files changed
+84
-72
lines changed- parquet
- src/arrow/async_reader
- tests/arrow_reader
2 files changed
+84
-72
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2181 | 2181 | | |
2182 | 2182 | | |
2183 | 2183 | | |
2184 | | - | |
2185 | | - | |
2186 | | - | |
2187 | | - | |
2188 | | - | |
2189 | | - | |
2190 | | - | |
2191 | | - | |
2192 | | - | |
2193 | | - | |
2194 | | - | |
2195 | | - | |
2196 | | - | |
2197 | | - | |
2198 | | - | |
2199 | | - | |
2200 | | - | |
2201 | | - | |
2202 | | - | |
2203 | | - | |
2204 | | - | |
2205 | | - | |
2206 | | - | |
2207 | | - | |
2208 | | - | |
2209 | | - | |
2210 | | - | |
2211 | | - | |
2212 | | - | |
2213 | | - | |
2214 | | - | |
2215 | | - | |
2216 | | - | |
2217 | | - | |
2218 | | - | |
2219 | | - | |
2220 | | - | |
2221 | | - | |
2222 | | - | |
2223 | | - | |
2224 | | - | |
2225 | | - | |
2226 | | - | |
2227 | | - | |
2228 | | - | |
2229 | | - | |
2230 | | - | |
2231 | | - | |
2232 | | - | |
2233 | | - | |
2234 | | - | |
2235 | | - | |
2236 | | - | |
2237 | | - | |
2238 | | - | |
2239 | | - | |
2240 | | - | |
2241 | | - | |
2242 | | - | |
2243 | | - | |
2244 | | - | |
2245 | | - | |
2246 | | - | |
2247 | | - | |
2248 | | - | |
2249 | | - | |
2250 | | - | |
2251 | | - | |
2252 | | - | |
2253 | | - | |
2254 | | - | |
2255 | 2184 | | |
2256 | 2185 | | |
2257 | 2186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
83 | 97 | | |
84 | 98 | | |
85 | 99 | | |
| |||
104 | 118 | | |
105 | 119 | | |
106 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
107 | 133 | | |
108 | 134 | | |
109 | 135 | | |
| |||
154 | 180 | | |
155 | 181 | | |
156 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
157 | 204 | | |
158 | 205 | | |
159 | 206 | | |
| |||
239 | 286 | | |
240 | 287 | | |
241 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 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 | + | |
242 | 325 | | |
243 | 326 | | |
244 | 327 | | |
| |||
0 commit comments