| 1425 | } else if (isSpecialForm()) { |
| 1426 | #else |
| 1427 | if (isSpecialForm()) { |
| 1428 | #endif |
| 1429 | evalSpecialFormWithStats(rows, context, result); |
| 1430 | return; |
| 1431 | } |
| 1432 | bool tryPeelArgs = deterministic_ ? true : false; |
| 1433 | bool defaultNulls = vectorFunction_->isDefaultNullBehavior(); |
| 1434 | |
| 1435 | // Tracks what subset of rows shall un-evaluated inputs and current expression |
| 1436 | // evaluates. Initially points to rows. |
| 1437 | MutableRemainingRows remainingRows(rows, context); |
| 1438 | if (defaultNulls) { |
| 1439 | ScopeNegatedRelationSetter negatedSetter( |
| 1440 | context, vectorFunction_->isNegated()); |
| 1441 | if (!evalArgsDefaultNulls( |
| 1442 | remainingRows, |
| 1443 | [&](auto i) { |
| 1444 | inputs_[i]->eval(remainingRows.rows(), context, inputValues_[i]); |
| 1445 | tryPeelArgs = |
| 1446 | tryPeelArgs && isPeelable(inputValues_[i]->encoding()); |
| 1447 | }, |
| 1448 | context, |
| 1449 | result)) { |
| 1450 | return; |
| 1451 | } |
| 1452 | } else { |
| 1453 | ScopeNegatedRelationSetter negatedSetter( |
| 1454 | context, vectorFunction_->isNegated()); |
| 1455 | if (!evalArgsWithNulls( |
| 1456 | remainingRows, |
| 1457 | [&](auto i) { |
| 1458 | inputs_[i]->eval(remainingRows.rows(), context, inputValues_[i]); |
| 1459 | tryPeelArgs = |
| 1460 | tryPeelArgs && isPeelable(inputValues_[i]->encoding()); |
| 1461 | }, |
| 1462 | context, |
| 1463 | result)) { |
| 1464 | return; |
| 1465 | } |
| 1466 | } |
| 1467 | |
| 1468 | if (!tryPeelArgs || |
| 1469 | !applyFunctionWithPeeling(remainingRows.rows(), context, result)) { |
| 1470 | applyFunction(remainingRows.rows(), context, result); |
| 1471 | } |
| 1472 | |
| 1473 | // Write non-selected rows in remainingRows as nulls in the result if some |
| 1474 | // rows have been skipped. |
| 1475 | if (remainingRows.mayHaveChanged()) { |
| 1476 | addNulls(rows, remainingRows.rows().asRange().bits(), context, result); |
| 1477 | } |
| 1478 | releaseInputValues(context); |
| 1479 | } |
| 1480 | |
| 1481 | bool Expr::applyFunctionWithPeeling( |
| 1482 | const SelectivityVector& applyRows, |
| 1483 | EvalCtx& context, |
| 1484 | VectorPtr& result) { |
nothing calls this directly
no test coverage detected