Open astefan opened 2 months ago
Pinging @elastic/es-analytical-engine (Team:Analytics)
Heya, there's already a bit of discussion on https://github.com/elastic/elasticsearch/issues/99758, which I think this is a duplicate of.
@alex-spies thank you for chiming in, I didn't search for an already existent issue, there are some of them around indeed. I've reworded a bit and extended the description of this one, hopefully this acts as a meta issue for all the rest. ES|QL needs a wide swipe of all functions and operators so that we have a consistent handling of this scenario.
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.