QL: Adapt nested fields extraction from "fields" API output to the new un-flattened strucutre#68745
Merged
astefan merged 2 commits intoelastic:ql_fields_api_implementationfrom Feb 9, 2021
Conversation
un-flattened structure
Collaborator
|
Pinging @elastic/es-ql (Team:QL) |
…stic/elasticsearch into 68722_implementation
bpintea
approved these changes
Feb 9, 2021
| DocumentField field = hit.field(fieldName); | ||
| DocumentField field = null; | ||
| if (hitName != null) { | ||
| // a nested field value is grouped under the nested parent name (ie dep.dep_name lives under "dep":[{dep_name:value}]) |
Contributor
There was a problem hiding this comment.
Suggested change
| // a nested field value is grouped under the nested parent name (ie dep.dep_name lives under "dep":[{dep_name:value}]) | |
| // a nested field value is grouped under the nested parent name (ie dep.dep_name lives under "dep":[{"dep_name":value}]) |
| // a nested field value is grouped under the nested parent name (ie dep.dep_name lives under "dep":[{dep_name:value}]) | ||
| field = hit.field(hitName); | ||
| } else { | ||
| field = hit.field(fieldName); |
Contributor
There was a problem hiding this comment.
To make sure, the fieldName is in this case a "doc-top-level" field, right?
Contributor
Author
There was a problem hiding this comment.
fieldName is the full field name (including the path): dep.dep_name for example.
costin
approved these changes
Feb 9, 2021
Member
costin
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the fast turnaround.
astefan
added a commit
that referenced
this pull request
Feb 10, 2021
astefan
added a commit
to astefan/elasticsearch
that referenced
this pull request
Feb 10, 2021
* Integrate "fields" API into QL (elastic#68467) * QL: retry SQL and EQL requests in a mixed-node (rolling upgrade) cluster (elastic#68602) * Adapt nested fields extraction from "fields" API output to the new un-flattened structure (elastic#68745) (cherry picked from commit ee5cc54)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
"fields" API ouput for nested fields is returning the values in a way that keeps the relationship between nested documents
Addresses #68722