| 155 | } |
| 156 | |
| 157 | void EvalCtx::addErrors( |
| 158 | const SelectivityVector& rows, |
| 159 | const ErrorVectorPtr& fromErrors, |
| 160 | ErrorVectorPtr& toErrors) const { |
| 161 | if (!fromErrors) { |
| 162 | return; |
| 163 | } |
| 164 | |
| 165 | ensureErrorsVectorSize(toErrors, fromErrors->size()); |
| 166 | rows.testSelected([&](auto row) { |
| 167 | if (!fromErrors->isIndexInRange(row)) { |
| 168 | return false; |
| 169 | } |
| 170 | if (!fromErrors->isNullAt(row) && toErrors->isNullAt(row)) { |
| 171 | toErrors->set( |
| 172 | row, |
| 173 | std::static_pointer_cast<std::exception_ptr>( |
| 174 | fromErrors->valueAt(row))); |
| 175 | } |
| 176 | return true; |
| 177 | }); |
| 178 | } |
| 179 | |
| 180 | void EvalCtx::restore(ContextSaver& saver) { |
| 181 | BOLT_TEST_ADJUST("bytedance::bolt::exec::EvalCtx::restore", this); |