Skip to content

[BUG] Deprecation of OpenSearch DSL format has affected the behavior of the explain API #4373

Description

@chet5619

What is the bug?
Deprecation of OpenSearch DSL format has affected the behavior of the explain API
#3280

Prior to OpenSearch 3.0 we could request DSL syntax using the following query:

POST /_plugins/_sql/_explain?format=json
{"query":"SELECT Shape, _id FROM railroads LIMIT 0,10000"}

result:

{
  "from": 0,
  "size": 10000,
  "_source": {
    "includes": [
      "Shape",
      "_id"
    ],
    "excludes": []
  }
}

With 3.0 we have noticed a couple of issues with our workflow.

  1. using format=json returns an error when used with explain API
{
  "error": {
    "reason": "Invalid SQL query",
    "details": "Failed to create executor due to unknown response format: json",
    "type": "IllegalArgumentException"
  },
  "status": 400
}
  1. if we dont use format=json then we run into issues with including a geoshape column
POST /_plugins/_sql/_explain
{"query":"SELECT Shape, _id FROM railroads LIMIT 0,10000"}
{
  "error": {
    "reason": "Invalid SQL query",
    "details": "can't resolve Symbol(namespace=FIELD_NAME, name=Shape) in type env",
    "type": "SemanticCheckException"
  },
  "status": 400
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    SQLbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions