andygrove commented on code in PR #11534:
URL: https://github.com/apache/datafusion/pull/11534#discussion_r1683087575
##########
datafusion/physical-expr/src/expressions/case.rs:
##########
@@ -256,6 +289,36 @@ impl CaseExpr {
Ok(ColumnarValue::Array(current_value))
}
+
+ /// This function evaluates the specialized case of:
+ ///
+ /// CASE WHEN condition THEN column
+ /// [ELSE NULL]
+ /// END
+ fn case_column_or_null(&self, batch: &RecordBatch) ->
Result<ColumnarValue> {
+ let when_expr = &self.when_then_expr[0].0;
+ let then_expr = &self.when_then_expr[0].1;
+ if let ColumnarValue::Array(bit_mask) = when_expr.evaluate(batch)? {
Review Comment:
actually, nm, your question is different. Yes, we could implement special
handling for `CASE WHEN [true|false] THEN` but I'm not sure that is a
real-world use case that is worth optimizing
--
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]