-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Labels
:Analytics/ES|QLAKA ESQLAKA ESQL>enhancement>tech debtTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)
Description
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 the EvaluatorMapper
and there are few aspects that can be improved:
- for foldable values we shouldn't let the compute engine ignore them (and treat the resulting values as
null
and add a warning in the headers). Those foldable values errors should be reported to the user (the query is basically incorrect) asVerificationExceptions
- establish a pattern/rule regarding the thrown exception for foldable values that don't meet functions' criteria. For example, the
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()
).- a
VerificationException
should always include the line and column where the error occured - once this exception pattern has been established our javadoc around contributing functions to ES|QL should be updated to reflect the desired behavior
- the javadoc of the
fold()
method should also include this information
- a
- mathematical operators have the same behavior. Another related one, but slightly different in the light of recent improvements in the same area is here.
- see if we can do better than dealing with these exceptions (and wrapping them in
VerificationExceptions
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.
alex-spies
Metadata
Metadata
Assignees
Labels
:Analytics/ES|QLAKA ESQLAKA ESQL>enhancement>tech debtTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)