-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[BUG] rename
does not work with struct
field
#3279
Labels
bug
Something isn't working
Comments
EXAMPLE Mapping: {
"mappings": {
"properties": {
"name": {
"type": "keyword"
},
"location": {
"type": "object",
"properties": {
"state": {
"type": "keyword"
},
"province": {
"type": "keyword"
},
"country": {
"type": "keyword"
},
"coordinates": {
"type": "object",
"properties": {
"latitude": {
"type": "double"
},
"longitude": {
"type": "double"
}
}
}
}
}
}
}
} Data (Bulk): {"index":{"_id":"1"}}
{"name": "Seattle", "location": { "state": "Washington", "country": "United States", "coordinates": {"latitude": 47.6061, "longitude": -122.3328}}}
{"index":{"_id":"2"}}
{"name": "Vancouver", "location": { "province": "British Columbia", "country": "Canada", "coordinates": {"latitude": 49.2827, "longitude": -123.1207}}} Query:
Response: {
"schema": [
{
"name": "name",
"type": "string"
},
{
"name": "location.coordinates",
"type": "struct"
},
{
"name": "location.country",
"type": "string"
},
{
"name": "location.province",
"type": "string"
},
{
"name": "location.state",
"type": "string"
},
{
"name": "renamed_location",
"type": "struct"
}
],
"datarows": [
[
"Seattle",
null,
null,
null,
null,
{
"state": "Washington",
"country": "United States",
"coordinates": {
"latitude": 47.6061,
"longitude": -122.3328
}
}
],
[
"Vancouver",
null,
null,
null,
null,
{
"province": "British Columbia",
"country": "Canada",
"coordinates": {
"latitude": 49.2827,
"longitude": -123.1207
}
}
]
],
"total": 2,
"size": 2 |
rename
does not work withstruct
fieldrename
does not work with struct
field
7 tasks
rename
does not work with struct
fieldrename
does not work with struct
field
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
What is the bug?
The
rename
command returns incorrect results when applied to astruct
field.While the renamed field is correctly added to the search results, additional fields are also added that correspond to each of the fields within the struct, and which contain
null
values.Consider the following input data:
Query:
source=input | rename location as renamed_location
Expected Results:
Actual Results:
How can one reproduce the bug?
See comment below for sample mapping, input data, query, and results.
What is the expected behaviour?
See above. Struct field should be renamed, not additional columns should be created.
What is your host/environment?
Not applicable.
Do you have any screenshots?
Not applicable. See example above and sample mapping, input data, query, and results in comment below.
Do you have any additional context?
Discovered during work on #3030.
The text was updated successfully, but these errors were encountered: