diff --git a/docs/source/library-user-guide/upgrading/55.0.0.md b/docs/source/library-user-guide/upgrading/55.0.0.md index 6097c8dc717df..322f57dd115aa 100644 --- a/docs/source/library-user-guide/upgrading/55.0.0.md +++ b/docs/source/library-user-guide/upgrading/55.0.0.md @@ -894,6 +894,41 @@ let plan = deserialize_bytes(&proto_bytes)?; See [PR #23827](https://github.com/apache/datafusion/pull/23827) for details. +### `RecursiveQuery` gained a `schema` field + +`datafusion_expr::logical_plan::RecursiveQuery` exposed the static (anchor) term's +schema to parent plans, which ignored columns that only the recursive term makes +nullable. The node now stores the schema reconciled from both terms explicitly, so +it can no longer be built with an exhaustive struct literal. + +**Who is affected:** + +- Code constructing `RecursiveQuery` with a struct literal. This change also + shipped in `54.1.0`, so the same migration applies within the `54` series. + +**Migration guide:** + +Build the node with `RecursiveQuery::try_new`, which computes the schema and +returns an error if the two terms do not have the same number of columns: + +```rust,ignore +// Before +let query = RecursiveQuery { + name, + static_term, + recursive_term, + is_distinct, +}; + +// After +let query = RecursiveQuery::try_new(name, static_term, recursive_term, is_distinct)?; +``` + +`RecursiveQueryExec::try_new` takes the reconciled schema as its second argument +for the same reason, rather than deriving it from its children. + +See [PR #22552](https://github.com/apache/datafusion/pull/22552) for details. + ### `MSRV` updated to 1.94.0 The Minimum Supported Rust Version (MSRV) has been updated to [`1.94.0`].