ES|QL: properly handle fold-time errors as VerificationExceptions #112672
Labels
:Analytics/ES|QL
AKA ESQL
>enhancement
Team:Analytics
Meta label for analytical engine team (ESQL/Aggs/Geo)
Description
A recent PR surfaced an inconsistency issue regarding functions that act on foldable values that are incorrect. For those functions the
fold()
method is called by theEvaluatorMapper
and there are few aspects that can be improved:null
and add a warning in the headers). Those foldable values errors should be reported to the user (the query is basically incorrect) asVerificationExceptions
replace
function throws aPatternSyntaxException
when the regex is incorrect. This one should be replaced withIllegalArgumentException
instead. If this syntax error comes from a foldable value, theIllegalArgumentException
should be wrapped in aVerificationException
(the exception being caught inEvaluatorMapper.fold()
).VerificationException
should always include the line and column where the error occuredfold()
method should also include this informationVerificationExceptions
inEvaluatorMapper.fold()
). The downside of doing it in theEvaluatorMappper.fold()
is that there will be only one error message reported, unlikeLogicalVerifier.verify()
which collects and report all of them.The text was updated successfully, but these errors were encountered: