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
SQL: do not ignore all fields whose names start with underscore #36214
Conversation
Pinging @elastic/es-search |
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
The test failure comes from the docs build. It installs the |
@nik9000 is the In case we need to keep it, @atorok do you know a way of running |
The mapper-size plugin is installed here because we run tests for its docs. We install almost all of the plugins when we're testing the docs. I don't think we should run the SQL tests in a cluster without the mapper-size plugin installed. I think SQL shouldn't include the |
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.
// Skip internal fields (name starting with underscore and its type reported by field_caps starts with underscore | ||
// as well). A meta field named "_version", for example, has the type named "_version". | ||
// Also, skip any of the blacklisted field names. | ||
if (false == (name.startsWith("_") && entry.getValue().values().stream().anyMatch(f -> f.getType().startsWith("_"))) && |
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.
Potentially move the types
declaration above the if to reduce the if:
types.values().stream().anyMatch()
Another option would be to do the type check further down when it is encountered - this would avoid creating a stream for every single field.
Is the name check still necessary ? Wouldn't the type check be enough.
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.
@costin I have pushed a new commit with a slightly different approach.
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.
Seems better this way.
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
* Do not ignore fields whose names start with underscore, unless they are meta fields. * Filter out _size field. (cherry picked from commit 347468e)
This is a fix for #36206.
The solution is to ignore the fields names starting with
_
only if their type names also starts with_
(a particularity of ES meta fields).