sql icon indicating copy to clipboard operation
sql copied to clipboard

[BUG] Rename does not work with nested fields

Open lezzago opened this issue 1 year ago • 2 comments

What is the bug? Rename does not work with nested fields. When I tried to rename a nested field, the renamed field would just have empty values. This is an example query that has issues:

source=otel-metrics-2024.05| rename `attributes.resource.attributes.service@name` as ServiceName | dedup ServiceName | fields ServiceName

How can one reproduce the bug? Make a similar query to the one below that renames a nested field

source=otel-metrics-2024.05| rename `attributes.resource.attributes.service@name` as ServiceName | fields ServiceName

What is the expected behavior? The values from the renamed field should not be empty

What is your host/environment?

  • OS: AWS OpenSearch 2.11

lezzago avatar Jun 12 '24 00:06 lezzago

Not sure if it relates to https://github.com/opensearch-project/OpenSearch/issues/14355. @penghuo, how does the RenameOperator work in SQL engine? If the implementation relates to rename field processor, it might be the bug of OpenSearch Core.

LantaoJin avatar Jun 14 '24 14:06 LantaoJin

[Catch All Triage - Attendees 1, 2, 3, 4, 5]

dblock avatar Jul 01 '24 16:07 dblock