Skip to content

Commit 855a47b

Browse files
AlvaroBalbinalamb
authored andcommitted
docs(upgrading): document RecursiveQuery schema field in upgrade guide (apache#23991)
Adding the `schema` field to `RecursiveQuery` broke downstream code that built the node with a struct literal, and the change was never written up for people upgrading. I added an upgrade guide entry for 55.0.0 that describes what changed, notes it also shipped in 54.1.0 so users on the 54 series find it, and shows how to move to `RecursiveQuery::try_new`. It is documentation only, so whether to revert the change on `branch-54` for 54.2.0 is still an open question. I pushed this to my fork first and the project's own CI workflows pass on the commit. Fixes apache#23886. Co-authored-by: Andrew Lamb <[email protected]>
1 parent 2d20db7 commit 855a47b

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

  • docs/source/library-user-guide/upgrading

‎docs/source/library-user-guide/upgrading/55.0.0.md‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,41 @@ let plan = deserialize_bytes(&proto_bytes)?;
11091109

11101110
See [PR #23827](https://github.com/apache/datafusion/pull/23827) for details.
11111111

1112+
### `RecursiveQuery` gained a `schema` field
1113+
1114+
`datafusion_expr::logical_plan::RecursiveQuery` exposed the static (anchor) term's
1115+
schema to parent plans, which ignored columns that only the recursive term makes
1116+
nullable. The node now stores the schema reconciled from both terms explicitly, so
1117+
it can no longer be built with an exhaustive struct literal.
1118+
1119+
**Who is affected:**
1120+
1121+
- Code constructing `RecursiveQuery` with a struct literal. This change also
1122+
shipped in `54.1.0`, so the same migration applies within the `54` series.
1123+
1124+
**Migration guide:**
1125+
1126+
Build the node with `RecursiveQuery::try_new`, which computes the schema and
1127+
returns an error if the two terms do not have the same number of columns:
1128+
1129+
```rust,ignore
1130+
// Before
1131+
let query = RecursiveQuery {
1132+
name,
1133+
static_term,
1134+
recursive_term,
1135+
is_distinct,
1136+
};
1137+
1138+
// After
1139+
let query = RecursiveQuery::try_new(name, static_term, recursive_term, is_distinct)?;
1140+
```
1141+
1142+
`RecursiveQueryExec::try_new` takes the reconciled schema as its second argument
1143+
for the same reason, rather than deriving it from its children.
1144+
1145+
See [PR #22552](https://github.com/apache/datafusion/pull/22552) for details.
1146+
11121147
### `ExecutionPlan::apply_expressions` is now a required method
11131148

11141149
`apply_expressions` has been added as a **required** method on the `ExecutionPlan`, `FileSource`, and `DataSource` traits. Any custom implementation of

0 commit comments

Comments
 (0)