-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ES|QL: fix generative tests #127560
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: fix generative tests #127560
Conversation
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
| private static String randomName(List<Column> previousOutput) { | ||
| String result = randomRawName(previousOutput); | ||
| if (result.isEmpty() // bug https://github.com/elastic/elasticsearch/issues/125870, we'll manage it as an error later | ||
| || result.contains("<") |
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.
Have you considered excluding <no-fields> from randomRawName instead?
And maybe create a static variable that excludes these two and be called in multiple places in this class; I see randomGroupableName and randomRawName excludes <all-fields-projected>.
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.
Actually, <all-fields-projected> is found in 8 places in this file...
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.
That's a good point.
From a purely functional point of view, <no-fields> is there and you can use it, so having it in the tests would make sense.
On the other hand, quoting all the <something> fields would probably make the test less effective in discovering other bugs.
I think I'll go with your suggestion and just add <no-fields> to a blacklist
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.
Oh... I just tested it with
from no_* | limit 1 | keep `<no-fields>`
Unknown column [<no-fields>], did you mean [<no-fields>]?
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 did some refactoring, now the management of special cases for field names is centralized.
astefan
left a comment
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
Refactoring of how field names are extracted from the output of the previous query, taking into consideration known issues.
Fixes: #127536