Parsing error to translate /_sql/translate use UPDATE

465 views Asked by At

I'm using the SQL translator on ElasticSearch on a query that had UPDATE keyword. I can translate SELECT queries, but UPDATE is not working.

POST /_sql/translate
{
    "query": "UPDATE inspections SET business_state='RS' WHERE business_city='Passo Fundo'"
}

Error:

{
  "error": {
    "root_cause": [
      {
        "type": "parsing_exception",
        "reason": "line 1:1: mismatched input 'UPDATE' expecting {'(', 'DEBUG', 'DESC', 'DESCRIBE', 'EXPLAIN', 'SELECT', 'SHOW', 'SYS', 'WITH'}"
      }
    ],
    "type": "parsing_exception",
    "reason": "line 1:1: mismatched input 'UPDATE' expecting {'(', 'DEBUG', 'DESC', 'DESCRIBE', 'EXPLAIN', 'SELECT', 'SHOW', 'SYS', 'WITH'}",
    "caused_by": {
      "type": "input_mismatch_exception",
      "reason": null
    }
  },
  "status": 400
}
1

There are 1 answers

0
jaspreet chahal On BEST ANSWER

Update SQL Command is not supported. Link lists the SQL command which are supported