| 35 | namespace bytedance::bolt::exec { |
| 36 | namespace { |
| 37 | VectorPtr toConstant( |
| 38 | const core::TypedExprPtr& expr, |
| 39 | core::ExpressionEvaluator* evaluator) { |
| 40 | auto exprSet = evaluator->compile(expr); |
| 41 | if (!exprSet->exprs()[0]->isConstant()) { |
| 42 | return nullptr; |
| 43 | } |
| 44 | RowVector input( |
| 45 | evaluator->pool(), ROW({}, {}), nullptr, 1, std::vector<VectorPtr>{}); |
| 46 | SelectivityVector rows(1); |
| 47 | VectorPtr result; |
| 48 | try { |
| 49 | evaluator->evaluate(exprSet.get(), rows, input, result); |
| 50 | } catch (const BoltUserError&) { |
| 51 | return nullptr; |
| 52 | } |
| 53 | return result; |
| 54 | } |
| 55 | |
| 56 | template <typename T> |
| 57 | T singleValue(const VectorPtr& vector) { |
no test coverage detected