Skip to content

[BUG] Calcite PPL doesn't handle integer array columns #4173

@Swiddis

Description

@Swiddis

Query Information

PPL Command/Query:
Anything matching the problematic fields (e.g. source = test_idx)

Expected Result:
When Calcite is disabled, this returns:

{
  "schema": [
    {
      "name": "nums",
      "type": "bigint"
    }
  ],
  "datarows": [
    [
      [
        1,
        2,
        3
      ]
    ]
  ],
  "total": 1,
  "size": 1
}

Actual Result:

{
  "error": {
    "reason": "There was internal problem at backend",
    "details": "class java.util.ArrayList cannot be cast to class java.lang.Long (java.util.ArrayList and java.lang.Long are in module java.base of loader 'bootstrap')",
    "type": "ClassCastException"
  },
  "status": 500
}

Dataset Information

Dataset/Schema Type

  • OpenTelemetry (OTEL)
  • Simple Schema for Observability (SS4O)
  • Open Cybersecurity Schema Framework (OCSF)
  • Custom (details below)

Index Mapping

{
  "test_idx": {
    "mappings": {
      "properties": {
        "nums": {
          "type": "long"
        }
      }
    }
  }
}

Sample Data

{ "nums": [1, 2, 3] }

Bug Description

Issue Summary:
Calcite fails to return any results containing a list of integers. This is probably related to the type in OpenSearch for these fields being long, with no indication of whether or not it contains an array.

Workaround: use fields and remove the problematic field.

Steps to Reproduce:

PUT localhost:9200/_cluster/settings
Content-Type: application/json

{
    "transient": {
        "plugins.calcite.enabled": true
    }
}

###
POST localhost:9200/test_idx/_doc
Content-Type: application/json

{ "nums": [1, 2, 3] }

###
POST localhost:9200/_plugins/_ppl
Content-Type: application/json

{
  "query": "source = test_idx"
}

Impact:
Anyone who previously used these fields in queries won't be able to do so on Calcite, though I'm not sure how prevalent they are.

Environment Information

OpenSearch Version:
Mainline (c54acc4)

Additional Details:
N/A

Screenshots

N/A

Metadata

Metadata

Assignees

Labels

PPLPiped processing languagebugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions