Hasnaathussain opened a new pull request, #24484: URL: https://github.com/apache/datafusion/pull/24484
## Which issue does this PR close? - Closes #21231. ## Rationale for this change A custom column-like `PhysicalExpr` can read an input column without downcasting to DataFusion's concrete `Column` type. CASE's internal projection then misses that dependency and evaluates the expression against a zero-column batch, causing a runtime error. ## What changes are included in this PR? CASE projection now falls back to the original input batch when it encounters an unknown leaf expression. Known columns, lambda variables, literals, and composite expressions keep the existing projection optimization. The regression test uses a custom `PhysicalExpr` that wraps a column without exposing a concrete `Column` node. ## Are these changes tested? Yes: - `cargo fmt --all -- --check` - `cargo clippy -p datafusion-physical-expr --all-targets --all-features -- -D warnings` - `cargo test -p datafusion-physical-expr expressions::case::tests` (36 passed) - `cargo test -p datafusion-physical-expr` (1,596 passed, 2 ignored; 13 doctests passed) The extended workspace command also reached the existing TPC-H q15 unparser failure. Its multi-statement error reproduces unchanged at the base commit, outside this patch. ## Are there any user-facing changes? Custom physical expressions can now be evaluated correctly inside searched CASE expressions. There is no public API change. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
