Skip to content

[BUG] Duplicate fields returned when disable_objects set #5746

Open

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

  1. added
    bug
    on Sep 3, 2026
  2. penghuo commented on Sep 8, 2026

    @penghuo
    Collaborator

    @tronboto Thanks for reporting the issue.

    Reproduced on 3.9.0-SNAPSHOT. Root cause is the field dedup check,

    With disable_objects: true, OpenSearch doesn't expand the dotted key into intermediate object mappers — the mapping holds one leaf literally named log.file.path. So flattening yields {attributes, attributes.log.file.path} with no attributes.log / attributes.log.file in between.

    tryToRemoveNestedFields (CalciteRelNodeVisitor.java:665) drops a field only when the prefix up to the last dot is also a field. attributes.log.file isn't, so the leaf survives next to the struct. attributes.logtag is dropped correctly — hence only multi-dot keys duplicate.

  3. added
    PPL
    and removed on Sep 8, 2026
  4. tronboto commented on Oct 5, 2026

    @tronboto
    Author

    Hey @penghuo . I see you closed your original PR for this. Any update on the new approach? It would be great to get this fixed for the next release.

  5. tronboto commented on Nov 5, 2026

    @tronboto
    Author

    Another side effect here is that you end up with many many null value fields:

    Image
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

    PPLbug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions