Skip to content

[BUG] Certain fields are unexpectedly not compatible with patterns command #4365

Closed as duplicate

Description

@paulstn

What is the bug?

In an index where the mapping is as below:

{
  "opensearch_dashboards_sample_data_ecommerce": {
    "aliases": {},
    "mappings": {
      "properties": {
        "category": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword"
            }
          }
        },
        "currency": {
          "type": "keyword"
        },
        "customer_birth_date": {
          "type": "date"
        },
        "customer_first_name": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
...

Running this PPL Query:

source = opensearch_dashboards_sample_data_ecommerce | patterns `category`

Returns this error:

"{\n  \"error\": {\n    \"reason\": \"Invalid Query\",\n    \"details\": \"failed to parse field \\\"category\\\" with type [ARRAY]\",\n    \"type\": \"SemanticCheckException\"\n  },\n  \"status\": 400\n}"

However, category just seems to be a text field.

When querying the documents, i see this as what category's values are:

"datarows": [
    [
      [
        "Men's Clothing"
      ]
    ],
    [
      [
        "Women's Clothing"
      ]
    ],
    [
      [
        "Women's Shoes",
        "Women's Clothing"
      ]
    ],
    [
      [
        "Women's Shoes",
        "Women's Clothing"
      ]
    ],
...

So it is an array, but this shouldn't stop patterns at least with the old behavior, according to @joshuali925.

Ideally I want one of two things to be happening instead:

  1. Return patterns back to a state when it would work with documents with value "array".
  2. Have some way of finding out which fields are of type "array" (currently I don't see how I can find that information just from the mapping)

How can one reproduce the bug?
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

What is the expected behavior?
A clear and concise description of what you expected to happen.

What is your host/environment?

  • OS: [e.g. iOS]
  • Version [e.g. 22]
  • Plugins

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

Do you have any additional context?
Add any other context about the problem.

Activity

  1. added
    bug
    on Sep 24, 2025
  2. songkant-aws commented on Sep 24, 2025

    @songkant-aws
    Collaborator

    I will fix this one

  3. songkant-aws commented on Sep 24, 2025

    @songkant-aws
    Collaborator

    But for now array of string is not supported yet for patterns command. Probably a low priority because before 2.19 it doesn't work either

  4. added
    PPL
    and removed on Oct 7, 2025
  5. moved this from Not Started to Won't do in PPL Trackeron Oct 20, 2025
  6. LantaoJin commented on Jan 6, 2026

    @LantaoJin
    Member

    Can we test it when #5015 merged? But it requires query fully pushdown.

  7. moved this from Won't do to Pending in PPL Trackeron Jan 6, 2026
  8. added
    error-experience
    on Feb 3, 2026
  9. qianheng-aws commented on Apr 15, 2026

    @qianheng-aws
    Collaborator

    Closing as duplicate of #5333 — consolidated umbrella issue for array values not treated as atomic values.

  10. moved this from Pending to Done in PPL Trackeron Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

PPLbugerror-experience

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions