opensearch-project / opensearch-project/sql
SQL should return more verbose and user-friendly error messages
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 176
- Forks
- 229
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 43
Description
Is your feature request related to a problem? Please describe.
Some queries use features that are not implemented or don't work properly. ClassCastException is a useless message for an end user.
curl -XPOST http://localhost:9200/_plugins/_sql -H 'Content-Type: application/json' -d '{"query": "SELECT 1>2 AS a FROM calcs GROUP BY a"}'
{
"error": {
"type": "ClassCastException",
"reason": "There was internal problem at backend",
"details": "class java.lang.String cannot be cast to class java.lang.Boolean (java.lang.String and java.lang.Boolean are in module java.base of loader \u0027bootstrap\u0027)"
},
"status": 503
}
opensearchsql> SELECT 1>1 as a FROM `calcs` GROUP BY a;
TransportError(500, 'ClassCastException', {'error': {'type': 'ClassCastException', 'reason': 'There was internal problem at backend', 'details': "class java.lang.String cannot be cast to class java.lang.Boolean (java.lang.String and java.lang.Boolean are in module java.base of loader 'bootstrap')"}, 'status': 503})
Describe the solution you'd like
If a query refers to a not implemented or unsupported feature, so the reply should say about it.
If a query fails (assuming no errors in syntax), the error should report about it.
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 by reproducing the failing GROUP BY queries against the SQL endpoint shown in the issue and inspect how their error responses are produced. The work is done when unsupported features and query failures return specific, user-friendly explanations instead of internal ClassCastException details.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, sql
- Domain
- api, backend, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100