Skip to content

SQL: incomplete error message for the wrong date comparison #30016

@elasticmachine

Description

@elasticmachine

Original comment by @astefan:

For a test case with dynamic mapping created following (which creates a date type field for release_date):

PUT /library/book/_bulk?refresh
{"index":{"_id": "1"}}
{"name": "Leviathan Wakes", "author": "James S.A. Corey", "release_date": "2011-06-02", "page_count": 561,"price":33.456}

a (wrong) sql query

POST /_xpack/sql
{
    "query": "SELECT name.keyword FROM library WHERE release_date >= 2011-06-02"
}

gives an error message (expected) but one that is incomplete:

{
  "error": {
    "root_cause": [
      {
        "type": "sql_illegal_argument_exception",
        "reason": "Line %d:%d - Comparisons against variables are not (currently) supported; offender %s in %s"
      }
    ],
    "type": "sql_illegal_argument_exception",
    "reason": "Line %d:%d - Comparisons against variables are not (currently) supported; offender %s in %s"
  },
  "status": 500
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions