-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ES|QL] Make EvaluatorMapper.fold() throw VerificationException for folding time errors Option #2 #119378
base: main
Are you sure you want to change the base?
[ES|QL] Make EvaluatorMapper.fold() throw VerificationException for folding time errors Option #2 #119378
Conversation
…xception thrown from ExpressionEvaluator
Hi @fang-xing-esql, I've created a changelog YAML for you. |
* This is called by {@code EvaluatorMapper.fold()}, {@code ConstantFolding} and {@code PropagateEvalFoldables}. | ||
* {@code EvaluatorMapper.fold()} is not aware of the location, null is provided for location. | ||
*/ | ||
public static VerificationException convertToVerificationException(Exception e, Location location) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of calling this method in ConstantFolding
and PropagateEvalFoldables
have you thought about calling it in Literal.of()
when the fold()
method is called on the Literal
constructor?
|
This is an alternative approach to wrap constant folding errors into
VerificationException
s, instead of returning warnings + nulls.Resolves: #112672
Resolves: #99758
Resolves: #108519
The first approach is here
Previously, the warnings/exceptions created by
ExpressionEvaluator
are stored inthread_context
, and they are not returned to planner after constant folding, so they are not visible to planner. This PR adds a methodevalFoldable
that throwException
s for errors happen during the evaluation of foldable expressions inExpressionEvaluator
, and it is called byEvaluatorMapper.fold()
duringLogicalPlanOptimizer
.evalFoldable
does not createwarnings
and add them intothread_context
, it throws theException
when there is error happens directly, later on theseExceptions
are wrapped intoVerificationException
s byEvaluatorMapper.fold()
,ConstantFolding
andPropagateEvalFoldables
.Conversion functions are not covered by this PR yet. There are some examples in the
CsvTests
that are referenced by docs.