# 5. Refactor schema rewriter groundwork * **Goal:** Prepare `PhysicalExprAdapter` internals for the final switch without changing external behavior. * **Scope & Location:** `datafusion/physical-expr-adapter/src/schema_rewriter.rs` (and any helpers it calls). * **Key Tasks:** * Isolate the structural cleanup already proposed (e.g., factor out helper functions, introduce quick struct compatibility checks) while keeping current cast behavior. * Add/adjust tests ensuring no functional change (existing `CastExpr` path still used). * Document new helper responsibilities to aid the next PR. * **Dependencies:** Independent of specs #17760, #17761, #17762, #17763 but should land before spec #6 to minimize diff. * **Out of Scope:** Introducing `CastColumnExpr` usage.
5. Refactor schema rewriter groundwork
Goal: Prepare
PhysicalExprAdapterinternals for the final switch without changing external behavior.Scope & Location:
datafusion/physical-expr-adapter/src/schema_rewriter.rs(and any helpers it calls).Key Tasks:
CastExprpath still used).Dependencies: Independent of specs Add a dedicated physical expression for struct-aware casting that mirrors the existing
cast_columnhelper semantics. #17760, Teach physical-expression utilities aboutCastColumnExpr#17761, Ensure plans containingCastColumnExprround-trip through protobuf for distributed execution. #17762, Update pruning to handleCastColumnExpr#17763 but should land before spec Consolidate TPC-H benchmarks #6 to minimize diff.Out of Scope: Introducing
CastColumnExprusage.