From 6be7efbba468377dc42a278a9ef7fa5c5f2e8f94 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Thu, 21 May 2026 07:39:08 -0400 Subject: [PATCH 1/3] Improve upgrade guide documentation about apply_expression --- docs/source/library-user-guide/upgrading/54.0.0.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/source/library-user-guide/upgrading/54.0.0.md b/docs/source/library-user-guide/upgrading/54.0.0.md index 0c3bf20a91ed5..cc89208f67ab2 100644 --- a/docs/source/library-user-guide/upgrading/54.0.0.md +++ b/docs/source/library-user-guide/upgrading/54.0.0.md @@ -15,7 +15,7 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---> +-->requied # Upgrade Guides @@ -171,7 +171,13 @@ where string types are preferred (`UNION`, `CASE THEN/ELSE`, `NVL2`). ### `ExecutionPlan::apply_expressions` is now a required method -`apply_expressions` has been added as a **required** method on the `ExecutionPlan` trait (no default implementation). The same applies to the `FileSource` and `DataSource` traits. Any custom implementation of these traits must now implement `apply_expressions`. +A new function, `apply_expressions` is now **required** for `ExecutionPlan`, +`FileSource` and `DataSource` traits, so any custom implementation of these +traits must now implement `apply_expressions`. + +`apply_expressions` is used to visit all `PhysicalExpr` instances owned by the +node, allowing the caller to apply a function to them (e.g. for expression +rewriting or analysis). **Who is affected:** From 3518fec915582119202916d1abb7d56e8f67bb1a Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Thu, 21 May 2026 07:40:37 -0400 Subject: [PATCH 2/3] cleanup --- docs/source/library-user-guide/upgrading/54.0.0.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/library-user-guide/upgrading/54.0.0.md b/docs/source/library-user-guide/upgrading/54.0.0.md index cc89208f67ab2..647a9afe355b2 100644 --- a/docs/source/library-user-guide/upgrading/54.0.0.md +++ b/docs/source/library-user-guide/upgrading/54.0.0.md @@ -15,7 +15,7 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --->requied +--> # Upgrade Guides @@ -171,8 +171,8 @@ where string types are preferred (`UNION`, `CASE THEN/ELSE`, `NVL2`). ### `ExecutionPlan::apply_expressions` is now a required method -A new function, `apply_expressions` is now **required** for `ExecutionPlan`, -`FileSource` and `DataSource` traits, so any custom implementation of these +A new function, `apply_expressions`, is now **required** for the `ExecutionPlan`, +`FileSource`, and `DataSource` traits, so any custom implementation of these traits must now implement `apply_expressions`. `apply_expressions` is used to visit all `PhysicalExpr` instances owned by the From efe3bcdc6f60ebf24c3f7f3a615f397dbe2b3e74 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Thu, 21 May 2026 07:41:56 -0400 Subject: [PATCH 3/3] cleanup --- docs/source/library-user-guide/upgrading/54.0.0.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/docs/source/library-user-guide/upgrading/54.0.0.md b/docs/source/library-user-guide/upgrading/54.0.0.md index 647a9afe355b2..a710daa35dc96 100644 --- a/docs/source/library-user-guide/upgrading/54.0.0.md +++ b/docs/source/library-user-guide/upgrading/54.0.0.md @@ -171,13 +171,9 @@ where string types are preferred (`UNION`, `CASE THEN/ELSE`, `NVL2`). ### `ExecutionPlan::apply_expressions` is now a required method -A new function, `apply_expressions`, is now **required** for the `ExecutionPlan`, -`FileSource`, and `DataSource` traits, so any custom implementation of these -traits must now implement `apply_expressions`. - -`apply_expressions` is used to visit all `PhysicalExpr` instances owned by the -node, allowing the caller to apply a function to them (e.g. for expression -rewriting or analysis). +`apply_expressions` is now **required** on the `ExecutionPlan`, `FileSource`, +and `DataSource` traits. It visits every `PhysicalExpr` owned by the node so +callers can analyze or rewrite them (e.g. to discover dynamic filters). **Who is affected:** @@ -186,7 +182,7 @@ rewriting or analysis). **Migration guide:** -Add `apply_expressions` to your implementation. Call `f` on each top-level `PhysicalExpr` your node owns, using `visit_sibling` to correctly propagate `TreeNodeRecursion`: +Call `f` on each top-level `PhysicalExpr` your node owns, using `visit_sibling` to propagate `TreeNodeRecursion` when iterating: **Node with no expressions:** @@ -225,7 +221,7 @@ fn apply_expressions( } ``` -**Node whose only expressions are in `output_ordering()` (e.g. a synthetic test node with no owned expression fields):** +**Node whose expressions live in `output_ordering()`:** ```rust,ignore fn apply_expressions(