Skip to content

[BUG] dedup raise 500 error when object attribute is specified #4339

Description

@ykmr1224

What is the bug?
dedup command raise 500 error when object attribute is specified.
Sample query:

source=logs-* | head 10 | dedup attributes

where attributes is struct like:

      {
        "cluster": {
          "name": "xyz-cluster1-ci-prod-us-east-1",
          "region": "us-east-1",
          "env": "prod"
        },
        "log": {
          "file": {
            "path": "/var/log/xyz/abc.log"
          }
        },
        "obs_body_length": 146
      },

error:

{
  "error": {
    "reason": "There was internal problem at backend",
    "details": "java.sql.SQLException: exception while executing query: class java.util.LinkedHashMap cannot be cast to class java.lang.Comparable (java.util.LinkedHashMap and java.lang.Comparable are in module java.base of loader 'bootstrap')",
    "type": "RuntimeException"
  },
  "status": 500
}

How can one reproduce the bug?
run ppl query: source=logs-* | head 10 | dedup attributes

What is the expected behavior?
It should return invalid query error with 4xx status code.

What is your host/environment?

  • OS: [e.g. iOS]
  • Version [e.g. 22] 3.1
  • 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
    PPL
    on Sep 19, 2025
  2. self-assigned this
    on Sep 22, 2025
  3. LantaoJin commented on Sep 22, 2025

    @LantaoJin
    Member

    checking

  4. LantaoJin commented on Oct 22, 2025

    @LantaoJin
    Member

    That's because the struct type cannot be sorted whatever in pushdown or non-pushdown. (the same behavior in v2)
    @ykmr1224 do you have any background about the usage? seen any user requirements?

  5. LantaoJin commented on Oct 22, 2025

    @LantaoJin
    Member

    Try this query in v2 and v3

    source = opensearch_dashboards_sample_data_ecommerce | sort geoip
    
  6. LantaoJin commented on Oct 22, 2025

    @LantaoJin
    Member

    Anyway, this issue (specific dedup an attribute) can be fixed because that dedup with object doesn't pushdown. So I can fix it in Calcite side. But query source = opensearch_dashboards_sample_data_ecommerce | sort geoip still fail since OpenSearch doesn't support sorting on an object field.

  7. moved this from Not Started to In review in PPL Trackeron Oct 22, 2025
  8. moved this from In review to Done in PPL Trackeron Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

PPLbug

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions