gvol opened a new pull request, #55494: URL: https://github.com/apache/arrow/pull/55494
### Rationale for this change - `ProjectRel` conversion calls `OutputType::type()` on the kernel signature which only supports fixed output types. - Valid expressions such as `case_when` compute their output types from their inputs. Deserializing these projections aborts in Debug builds, and presumably leads to bad behavior in Release builds. ### What changes are included in this PR? - Use the output type that Bind resolves for the projected field. - Add a regression test with an `IfThen` expression that maps to `case_when`. The test checks the converted schema and query results. It aborts in Debug mode without the corresponding fix. ### Are these changes tested? - Added a new test which passes after the changes. - Ran other tests in Debug mode with the following command ```sh cmake --build cpp/build-debug --target arrow-substrait-substrait-test -j 8 ARROW_TEST_DATA="$PWD/testing/data" PARQUET_TEST_DATA="$PWD/cpp/submodules/parquet-testing/data" cpp/build-debug/debug/arrow-substrait-substrait-test ``` ### Are there any user-facing changes? There are no public API changes apart from the lack of `abort()`. **This PR contains a "Critical Fix".**, namely a bug that causes a crash (in Debug mode). ### Was AI used for this PR? In accordance to the [AI generation guidelines](https://arrow.apache.org/docs/dev/developers/overview.html#ai-generated-code), please disclose below whether and how AI was used in this PR. **PR code and description written by:** - [X] Human - I wrote some of the PR description and commit messages. - [X] AI **Reviewed before submission by:** - [X] Human - though I am unfamiliar with the arrow code base, the change and test look sane to me. - [X] AI - [ ] Not reviewed -- 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]
