aweltsch commented on PR #14283: URL: https://github.com/apache/datafusion/pull/14283#issuecomment-2614269939
I have two questions: 1. If we assume that the expressions in the `CaseExpr` (both `when_then_expr` and `else_expr`) are of the correct type, can we then not remove all of `try_cast` for the `else_expr` that are sprinkled in the code as well? 2. Would it make sense to return an error already during `try_new` if the types of are incorrect? We could add a helpful message like `"[...] you can use 'get_coerce_type_for_case_expression' to get the appropriate types."`. My feeling is that this would enforce the invariant 'when-then and else expr types are consistent' and catch errors already during expression construction vs execution (fail early). -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org