Commit 63ad991
Add
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax. For example
`Closes #123` indicates that this PR will close issue #123.
-->
- Closes #22645.
## Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->
This follows up on #22607 by replacing range-partitioning sqllogictest
boilerplate with a general file/listing scan API for declared output
partitioning.
Related: #21992, #22607,
#22607 (comment)
## What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->
- Add declared `output_partitioning` to file scan and listing table
configuration.
- Preserve declared partition counts during listing-table file grouping.
- Serialize scan `output_partitioning` through physical plan proto.
- Refactor `range_partitioning.slt` to use a CSV `ListingTable` instead
of a custom test-only `TableProvider` / `DataSource`.
Contract:
- Declared partitioning expressions are written against the full table
schema before scan projection. For example, `Range([range_key@0], [(10),
(20)], 3)` remains valid if the scan projects `range_key` and falls back
to `UnknownPartitioning(3)` if `range_key` is not projected.
- Listing tables create one file group per declared output partition
(which can exceed `target_partitions`). It is up to the user to plan
their partitioning. For example, a 4-partition range declaration creates
four scan file groups, adding empty trailing groups when fewer files are
present.
- File group index is part of the contract: file group `i` must contain
rows for declared output partition `i`. DataFusion does not validate row
placement, matching other user-declared properties such as sortedness.
## Are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?
-->
Yes.
## Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.
-->
Yes. This adds public API for declaring file/listing scan output
partitioning. No breaking API changes.
<!--
If there are any breaking changes to public APIs, please add the `api
change` label.
-->
---------
Co-authored-by: Gabriel <45515538+gabotechs@users.noreply.github.com>ListingOptions::output_partitioning and FileScanConfig::output_partitioning for pre-defined file partitioning (#22657)1 parent 91f30b9 commit 63ad991
18 files changed
Lines changed: 1020 additions & 395 deletions
File tree
- datafusion
- catalog-listing/src
- core/src
- datasource/listing
- datasource/src/file_scan_config
- physical-expr/src
- proto-models
- proto
- src/generated
- proto
- src/physical_plan
- tests/cases
- sqllogictest
- src/test_context
- test_files
Some 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 | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
328 | | - | |
| 328 | + | |
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| |||
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
450 | | - | |
| 450 | + | |
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 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 | + | |
| 94 | + | |
| 95 | + | |
56 | 96 | | |
57 | 97 | | |
58 | 98 | | |
| |||
66 | 106 | | |
67 | 107 | | |
68 | 108 | | |
| 109 | + | |
69 | 110 | | |
70 | 111 | | |
71 | 112 | | |
| |||
113 | 154 | | |
114 | 155 | | |
115 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
116 | 168 | | |
117 | 169 | | |
118 | 170 | | |
| |||
0 commit comments