Skip to content

[BUG] PPL query return null when access valid inner json object #4906

@penghuo

Description

@penghuo

How can one reproduce the bug?

###
PUT {{baseUrl}}/log00001
Content-Type: application/x-ndjson

{
  "mappings": {
    "properties": {
      "log": {
        "type": "object",
        "enabled": false
      }
    }
  }
}

###
POST {{baseUrl}}/log00001/_bulk
Content-Type: application/x-ndjson

{"index": {}}
{"log": {"a":1, "c": {"d": 2}}}

###
POST {{baseUrl}}/_plugins/_ppl/
Content-Type: application/x-ndjson

{
  "query": "source=log00001 | fields log.c.d"
}
  • Results
{
  "schema": [
    {
      "name": "log.c.d",
      "type": "undefined"
    }
  ],
  "datarows": [
    [
      null
    ]
  ],
  "total": 1,
  "size": 1
}

What is the expected behavior?
It should return

{
  "schema": [
    {
      "name": "log.c.d",
      "type": "int"
    }
  ],
  "datarows": [
    [
      2
    ]
  ],
  "total": 1,
  "size": 1
}

Metadata

Metadata

Assignees

Labels

PPLPiped processing languagebugSomething isn't working

Type

No type

Projects

Status

Not Started

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions