Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] PPL query executed on an object field with dynamic mapping disabled returns an empty result #3343

Open
penghuo opened this issue Feb 24, 2025 · 0 comments
Labels
bug Something isn't working calcite calcite migration releated

Comments

@penghuo
Copy link
Collaborator

penghuo commented Feb 24, 2025

What is the bug?
A PPL query executed on an object field with dynamic mapping disabled returns an empty result. PPL supports OpenSearch object fields with dynamic mapping, where an object field is mapped to a struct type field. If a sub-field does not exist, references to that sub-field are resolved as missing values.

How can one reproduce the bug?

### create index, profile field is object type, dynamic disabled.
PUT {{baseUrl}}/test001
Content-Type: application/x-ndjson

{
  "mappings": {
    "properties": {
      "profile": {
        "type": "object",
        "dynamic": false
      }
    }
  }
}

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

{"index": {"_index": "test001"}}
{"profile": {"age": 1}}
{"index": {"_index": "test001"}}
{"profile": {"address": "a"}}

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

{
  "query": "source = test001 "
}

### return empty result.
{
  "schema": [
    {
      "name": "profile",
      "type": "struct"
    }
  ],
  "datarows": [
    [
      {}
    ],
    [
      {}
    ]
  ],
  "total": 2,
  "size": 2
}

What is the expected behavior?
The expected a new data type

@penghuo penghuo added bug Something isn't working untriaged calcite calcite migration releated labels Feb 24, 2025
@penghuo penghuo changed the title [BUG] PPL query executed on an object field with dynamic mapping disabled returns an empty result. [BUG] PPL query executed on an object field with dynamic mapping disabled returns an empty result Feb 24, 2025
@penghuo penghuo removed the untriaged label Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working calcite calcite migration releated
Projects
None yet
Development

No branches or pull requests

1 participant