-
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
EQL: Expand verification tests #52664
EQL: Expand verification tests #52664
Conversation
Fix some error messaging consistency in EqlParser Related to elastic#51873
Pinging @elastic/es-search (:Search/EQL) |
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.
Nice addition of tests.
I left two comments about MATCH/QUERY predicates inside an error message.
accept(idxr, "foo where integer_field == " + | ||
"0"); |
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.
Single line, please.
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.
will update
|
||
assertEquals("1:11: Unknown column [endgame.pi], did you mean [endgame.pid]?", | ||
error(idxr, "foo where endgame.pi == 0")); | ||
|
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.
Please, remove extra empty line.
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.
I kind of liked the one line visual separation between successful and failure cases in here
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.
This empty line is at the end of the method, before the closing }
bracket...
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.
will fix
accept(idxr, "foo where multi_field.raw == 'bar'"); | ||
|
||
assertEquals("1:11: [multi_field.english == 'bar'] cannot operate on first argument field of data type [text]: " + | ||
"No keyword/multi-field defined exact matches for [english]; define one or use MATCH/QUERY instead", |
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.
I think this error message is wrong, unless EQL plans to support MATCH/QUERY predicates.
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.
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.
@aleksmaus please raise an issue and mark it as discuss to get consensus about how we deal with exact matches on analyzed fields - whether we prevent any exact comparison against them or introduce some other type of comparison (inexact matches - say ~=
).
error(idxr, "foo where multi_field_ambiguous.normalized == 'bar'")); | ||
|
||
assertEquals("1:11: [multi_field_nested.dep_name == 'bar'] cannot operate on first argument field of data type [text]: " + | ||
"No keyword/multi-field defined exact matches for [dep_name]; define one or use MATCH/QUERY instead", |
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.
Same here about MATCH/QUERY predicates.
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.
Discussed with Costin, the behavior is correct, the error message can be improved in the context of EQL. Agreed on leaving the test as is and open an "issue" for error messaging improvement for this particular case. Possibly can bring up for discussion for our weekly.
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.
Looks really good. Thanks Aleks!
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.
LGTM
Expand verification tests Fix some error messaging consistency in EqlParser Related to elastic#51873
Expand verification tests
Fix some error messaging consistency in EqlParser
Related to #51873
@costin Could you take a look and let me know if this is what you were looking for that github issue.
Thanks!