opensearch-project / opensearch-project/sql
[BUG] Deprecation of OpenSearch DSL format has affected the behavior of the explain API
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 176
- Forks
- 229
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 43
Description
What is the bug?
Deprecation of OpenSearch DSL format has affected the behavior of the explain API
https://github.com/opensearch-project/sql/issues/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.
- using
format=jsonreturns 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
}
- if we dont use
format=jsonthen 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
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the SQL explain API endpoint and trace handling for the format=json request and for geoshape field resolution. Compare the documented pre-3.0 behavior with the two OpenSearch 3.0 failures; the work is done when both example explain requests produce valid results without errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, sql
- Domain
- api, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100