Commit d8e68a4
authored
refactor: add ParquetOpenerBuilder to reduce test code duplication (#19405)
## Which issue does this PR close?
- Closes #19333
## Rationale for this change
The test suite for `ParquetOpener` exhibited substantial code
duplication across multiple test functions. Each test was constructing
`ParquetOpener` instances with largely identical field values, resulting
in verbose and repetitive code that hindered maintainability and
obscured the distinguishing characteristics of each test case.
## What changes are included in this PR?
- Added `ParquetOpenerBuilder` struct in the test module
(`#[cfg(test)]`) with sensible defaults matching the original test code
patterns
- Refactored 8 test functions to use the builder pattern:
- `test_prune_on_statistics`
- `test_prune_on_partition_statistics_with_dynamic_expression`
- `test_prune_on_partition_values_and_file_statistics`
- `test_prune_on_partition_value_and_data_value`
- `test_opener_pruning_skipped_on_static_filters`
- `test_reverse_scan_row_groups`
- `test_reverse_scan_single_row_group`
- `test_reverse_scan_with_row_selection`
- Reduced code from ~28 lines per test to ~6-8 lines, highlighting only
the fields that differ
## Are these changes tested?
Yes
## Are there any user-facing changes?
No1 parent 32e6fe8 commit d8e68a4
1 file changed
+230
-225
lines changed
0 commit comments