rluvaton commented on code in PR #18329:
URL: https://github.com/apache/datafusion/pull/18329#discussion_r2470313982
##########
datafusion/physical-expr/src/expressions/case.rs:
##########
@@ -950,22 +1119,14 @@ impl CaseExpr {
_ => Cow::Owned(prep_null_mask_filter(when_value)),
};
- let then_value = self.when_then_expr[0]
- .1
- .evaluate_selection(batch, &when_value)?
- .into_array(batch.num_rows())?;
-
- // evaluate else expression on the values not covered by when_value
- let remainder = not(&when_value)?;
- let e = self.else_expr.as_ref().unwrap();
- // keep `else_expr`'s data type and return type consistent
- let expr = try_cast(Arc::clone(e), &batch.schema(),
return_type.clone())
- .unwrap_or_else(|_| Arc::clone(e));
- let else_ = expr
- .evaluate_selection(batch, &remainder)?
- .into_array(batch.num_rows())?;
-
- Ok(ColumnarValue::Array(zip(&remainder, &else_, &then_value)?))
+ if projected.projection.len() < batch.num_rows() {
Review Comment:
```suggestion
if projected.projection.len() < batch.num_columns() {
```
--
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]