MCPcopy Create free account
hub / github.com/apache/datafusion / evaluate

Method evaluate

datafusion/physical-expr/src/expressions/case.rs:1318–1340  ·  view source on GitHub ↗
(&self, batch: &RecordBatch)

Source from the content-addressed store, hash-verified

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![];

Callers 15

case_when_with_exprMethod · 0.45
case_when_no_exprMethod · 0.45
expr_or_exprMethod · 0.45
case_column_or_nullMethod · 0.45
scalar_or_scalarMethod · 0.45
with_lookup_tableMethod · 0.45
evaluate_predicateFunction · 0.45
case_with_exprFunction · 0.45

Calls 6

case_when_with_exprMethod · 0.80
case_when_no_exprMethod · 0.80
case_column_or_nullMethod · 0.80
scalar_or_scalarMethod · 0.80
expr_or_exprMethod · 0.80
with_lookup_tableMethod · 0.80

Tested by 15

case_with_exprFunction · 0.36
case_with_expr_elseFunction · 0.36
case_without_exprFunction · 0.36
case_with_expr_when_nullFunction · 0.36
case_without_expr_elseFunction · 0.36
case_with_type_castFunction · 0.36