Skip to content

[FEATURE] Support merging object-type fields when fetching the schema from the index #3625

@penghuo

Description

@penghuo

Is your feature request related to a problem?
Currently, when the same object field (e.g., log) contains different inner fields in different indices, PPL randomly pick one, then PPL fails to resolve queries referencing any of them.

  • with data
###
POST {{baseUrl}}/logs-test-ppl-json-plain/_doc
Content-Type: application/x-ndjson

{
  "@timestamp": "2025-05-05T09:33:00Z",
  "message": "text message 3",
  "log": {
    "file": "/var/log/msg"
  }
}

###
POST {{baseUrl}}/logs-test-ppl-json-default/_doc
Content-Type: application/x-ndjson

{
  "message": "json message 1",
  "@timestamp": "2025-05-13T09:55:00Z",
  "log": {
    "level": "ERROR"
  }
}
  • run query
source = logs-* | where log.file= '/var/log/msg'

{
  "error": {
    "reason": "Invalid Query",
    "details": "can't resolve Symbol(namespace=FIELD_NAME, name=log.file) in type env",
    "type": "SemanticCheckException"
  },
  "status": 400
}

What solution would you like?
PPL should support merging object-type field definitions across indices (e.g., log.file, log.level) into a unified schema, so queries can reference valid fields even if they're only present in some indices.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions