Skip to content

[BUG] PPL throws a CalciteUnsupportedException when the query includes both multi_match and json_extract #3771

@penghuo

Description

@penghuo

What is the bug?

  • Execute multi_match works as expect
###
POST {{baseUrl}}/_plugins/_ppl
Content-Type: application/x-ndjson

{
    "query": "source= test001 multi_match(['*'], 'CheckoutService')"
}
  • Execute json_extract works as expect
###
POST {{baseUrl}}/_plugins/_ppl/
Content-Type: application/x-ndjson

{
    "query": "source= test001 | eval appName=json_extract(context, 'AppName') | fields appName"
}
  • But combine multi_match and json_extract throw "org.opensearch.sql.exception.CalciteUnsupportedException: Relevance fields expression is unsupported in Calcite"
###
POST {{baseUrl}}/_plugins/_ppl
Content-Type: application/x-ndjson

{
    "query": "source= test001 multi_match(['*'], 'CheckoutService') | eval appName=json_extract(context, 'AppName')"
}

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

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

Do you have any additional context?
Prepare index and data

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

{
  "mappings": {
    "properties": {
      "@timestamp": { "type": "date" },
      "message": { "type": "text" },
      "context": {
        "type": "text"
      }
    }
  }
}

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

{ "index": {} }
{ "@timestamp": "2025-06-02T11:00:00", "message": "Response received endpoint=/purchase url=/buy status=500", "context": "{\"AppId\":\"app01\",\"AppName\":\"CheckoutService\"}"}
{ "index": {} }
{ "@timestamp": "2025-06-02T12:00:00", "message": "Response received endpoint=/purchase url=/buy status=500",  "context": "{\"AppId\":\"app01\",\"AppName\":\"CheckoutService\"}"}
{ "index": {} }
{ "@timestamp": "2025-06-02T13:00:00", "message": "Response received endpoint=/purchase url=/buy status=200", "context": "{\"AppId\":\"app01\",\"AppName\":\"CheckoutService\"}"}

Metadata

Metadata

Assignees

Labels

PPLPiped processing languagePriority-LowbugSomething isn't workingcalcitecalcite migration releated

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions