andygrove commented on code in PR #11534:
URL: https://github.com/apache/datafusion/pull/11534#discussion_r1683080801
##########
datafusion/physical-expr/src/expressions/case.rs:
##########
@@ -89,10 +110,22 @@ impl CaseExpr {
if when_then_expr.is_empty() {
exec_err!("There must be at least one WHEN clause")
} else {
+ let eval_method = if expr.is_some() {
+ EvalMethod::CaseWithExpression
+ } else if when_then_expr.len() == 1
+ && when_then_expr[0].1.as_any().is::<Column>()
+ && else_expr.is_none()
Review Comment:
From SQL planning, it will be `None`, but it makes sense to add code here to
normalize this for other use cases (other query engines that delegate to
DataFusion). I have added this.
--
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]