Skip to content

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

Open

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.

Activity

  1. added
    enhancement
    on Nov 9, 2021
  2. added
    tdvt
    on Nov 24, 2021
  3. added
    error-experience
    on Feb 2, 2026
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

    enhancementerror-experiencetdvt

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions