| 1316 | } |
| 1317 | |
| 1318 | fn evaluate(&self, batch: &RecordBatch) -> Result<ColumnarValue> { |
| 1319 | match &self.eval_method { |
| 1320 | EvalMethod::WithExpression(p) => { |
| 1321 | // this use case evaluates "expr" and then compares the values with the "when" |
| 1322 | // values |
| 1323 | self.case_when_with_expr(batch, p) |
| 1324 | } |
| 1325 | EvalMethod::NoExpression(p) => { |
| 1326 | // The "when" conditions all evaluate to boolean in this use case and can be |
| 1327 | // arbitrary expressions |
| 1328 | self.case_when_no_expr(batch, p) |
| 1329 | } |
| 1330 | EvalMethod::InfallibleExprOrNull => { |
| 1331 | // Specialization for CASE WHEN expr THEN column [ELSE NULL] END |
| 1332 | self.case_column_or_null(batch) |
| 1333 | } |
| 1334 | EvalMethod::ScalarOrScalar => self.scalar_or_scalar(batch), |
| 1335 | EvalMethod::ExpressionOrExpression(p) => self.expr_or_expr(batch, p), |
| 1336 | EvalMethod::WithExprScalarLookupTable(lookup_table) => { |
| 1337 | self.with_lookup_table(batch, lookup_table) |
| 1338 | } |
| 1339 | } |
| 1340 | } |
| 1341 | |
| 1342 | fn children(&self) -> Vec<&Arc<dyn PhysicalExpr>> { |
| 1343 | let mut children = vec![]; |