Repository navigation
Commit a31d4ad
refactor(proto): restore common-type conversions as From/TryFrom in proto-models
`UnnestOptions`, `TableReference`, `StringifiedPlan`, `JoinType`,
`JoinConstraint`, `NullEquality`, `CsvOptions`, `JsonOptions` and the parquet
options types all live in `datafusion-common`, which sits below
`datafusion-proto-models` in the crate graph and so cannot host the impls.
They move onto the local proto type in `datafusion-proto-models` instead — the
arrangement `datafusion-proto-common` already uses for `ScalarValue` and
`Statistics` — and go back to being plain `From` / `TryFrom`, the shape they
had in 54.1.0.
This is also the only crate that can express
`TryFrom<&[PartitionedFile]> for protobuf::FileGroup`. `datafusion-datasource`
cannot: `&T` is `#[fundamental]` but `[T]` is not, so `&[PartitionedFile]`
counts as foreign there. Here the *self* type is local, which is all the orphan
rule needs, and staying generic over the element (`&T: TryInto<protobuf::PartitionedFile>`)
means this crate never has to name `PartitionedFile`, which sits above it.
Callers get the 54.1.0 spelling back verbatim.
New `datafusion_proto_models::{from_proto, to_proto}` modules; the crate gains
a direct `datafusion-common` dependency (already present transitively via
`datafusion-proto-common`).
Part of apache#24019.
Co-Authored-By: Claude Opus 5 <[email protected]>1 parent 7aa1b94 commit a31d4ad
11 files changed
Lines changed: 913 additions & 710 deletions
File tree
- datafusion
- datasource/src
- proto-models
- src
- proto
- src/logical_plan
- tests/cases
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 | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
267 | 286 | | |
268 | 287 | | |
269 | 288 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
0 commit comments