| 33 | namespace bytedance::bolt::exec { |
| 34 | |
| 35 | void TryExpr::evalSpecialForm( |
| 36 | const SelectivityVector& rows, |
| 37 | EvalCtx& context, |
| 38 | VectorPtr& result) { |
| 39 | ScopedVarSetter throwOnError(context.mutableThrowOnError(), false); |
| 40 | // It's possible with nested TRY expressions that some rows already threw |
| 41 | // exceptions in earlier expressions that haven't been handled yet. To avoid |
| 42 | // incorrectly handling them here, store those errors and temporarily reset |
| 43 | // the errors in context to nullptr, so we only handle errors coming from |
| 44 | // expressions that are children of this TRY expression. |
| 45 | // This also prevents this TRY expression from leaking exceptions to the |
| 46 | // parent TRY expression, so the parent won't incorrectly null out rows that |
| 47 | // threw exceptions which this expression already handled. |
| 48 | ScopedVarSetter<ErrorVectorPtr> errorsSetter(context.errorsPtr(), nullptr); |
| 49 | inputs_[0]->eval(rows, context, result); |
| 50 | |
| 51 | nullOutErrors(rows, context, result); |
| 52 | } |
| 53 | |
| 54 | void TryExpr::evalSpecialFormSimplified( |
| 55 | const SelectivityVector& rows, |
nothing calls this directly
no test coverage detected