| 154 | } |
| 155 | |
| 156 | std::pair< |
| 157 | std::vector<VectorPtr>, |
| 158 | std::unordered_map<std::string, exec::ExprStats>> |
| 159 | evaluateMultipleWithStats( |
| 160 | const std::vector<std::string>& texts, |
| 161 | const RowVectorPtr& input, |
| 162 | std::vector<VectorPtr> resultToReuse = {}) { |
| 163 | auto exprSet = compileMultiple(texts, asRowType(input->type())); |
| 164 | |
| 165 | exec::EvalCtx context(execCtx_.get(), exprSet.get(), input.get()); |
| 166 | |
| 167 | SelectivityVector rows(input->size()); |
| 168 | if (resultToReuse.empty()) { |
| 169 | resultToReuse.resize(texts.size()); |
| 170 | } |
| 171 | exprSet->eval(rows, context, resultToReuse); |
| 172 | return {resultToReuse, exprSet->stats()}; |
| 173 | } |
| 174 | |
| 175 | VectorPtr evaluate(const std::string& text, const RowVectorPtr& input) { |
| 176 | return evaluateMultiple({text}, input)[0]; |