Skip to content

SQL should return more verbose and user-friendly error messages #275

@Yury-Fridlyand

Description

@Yury-Fridlyand

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttdvtTableau test framework

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions