MCPcopy Create free account
hub / github.com/bytedance/bolt / evalSpecialForm

Method evalSpecialForm

bolt/expression/TryExpr.cpp:35–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33namespace bytedance::bolt::exec {
34
35void 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
54void TryExpr::evalSpecialFormSimplified(
55 const SelectivityVector& rows,

Callers

nothing calls this directly

Calls 3

mutableThrowOnErrorMethod · 0.80
errorsPtrMethod · 0.80
evalMethod · 0.45

Tested by

no test coverage detected