Skip to content

[BUG] Duplicate fields returned when disable_objects set #5746

Description

@tronboto

What is the bug?

Fields are duplicated in search results when objects have disable_objects set to true.

How can one reproduce the bug?

  1. Create the index with disable_objects: true, index a document and query using the PPL API
PUT test-disable-objects
{
  "mappings": {
    "properties": {
        "attributes": {
          "disable_objects": true,
          "type": "object"
        }
      }
  }
}

POST test-disable-objects/_doc
{
  "attributes": {
    "log.file.path": "/var/log/app.log"
  }
}

POST _plugins/_ppl
{
  "query" : "source=test-disable-objects"
}
  1. This returns both an attributes struct field and a log.file.path string field:
{
  "schema": [
    {
      "name": "attributes",
      "type": "struct"
    },
    {
      "name": "attributes.log.file.path",
      "type": "string"
    }
  ],
  "datarows": [
    [
      {
        "log": {
          "file": {
            "path": "/var/log/app.log"
          }
        }
      },
      "/var/log/app.log"
    ]
  ],
  "total": 1,
  "size": 1
}

What is the expected behavior?

Fields should not be duplicated

What is your host/environment?

Opensearch 3.8.0

Do you have any screenshots?
If applicable, add screenshots to help explain your problem.

Do you have any additional context?

This causes fields to be duplicated in the Opensearch Dashboards Explore Logs app:

Image

Interestingly, there is no attributes.logtag in that screenshot, which suggests the bug only presents itself when there are multiple layers of nesting.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    PPLPiped processing languagebugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions