Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Arithmetic operations not supported in WHERE clause #234

Closed
jordanw-bq opened this issue Oct 18, 2019 · 2 comments
Closed

Arithmetic operations not supported in WHERE clause #234

jordanw-bq opened this issue Oct 18, 2019 · 2 comments
Assignees
Labels
BI integration Issues for integration with BI tools enhancement New feature or request SQL

Comments

@jordanw-bq
Copy link
Contributor

jordanw-bq commented Oct 18, 2019

Using Docker image amazon/opendistro-for-elasticsearch:1.1.0
Dataset: Flights sample data (loaded through Kibana)
SQL Plugin version: 1.1.0.1

Example Query:
SELECT FlightNum FROM kibana_sample_data_flights where (AvgTicketPrice + 100) <= 1000

Result:

Raw response received: {
  "error": {
    "reason": "Invalid SQL query",
    "details": "No enum constant com.amazon.opendistroforelasticsearch.sql.domain.Where.CONN.<=",
    "type": "IllegalArgumentException"
  },
  "status": 400
}

Expected Behaviour:
No error, and the operation should be applied to the field before the comparison is made.
Example results:

| FlightNum | 
| 9HY9SWR | 
| X98CCZO | 
| UFK2WIZ | 
| EAYQW69 | 
| 58U013N | 
| XEJ78I2 | 
| EVARI8I | 
...
@dai-chen
Copy link
Member

Similar as this one: #194. Currently we don't support arithmetic expression anywhere in query.

@dai-chen
Copy link
Member

This is already fixed in new query engine. However, the new engine is disabled by default for now. You can enable it by following the instruction here: https://github.com/opendistro-for-elasticsearch/sql/blob/master/docs/user/admin/settings.rst#opendistro-sql-engine-new-enabled

@dai-chen dai-chen added the SQL label Aug 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
BI integration Issues for integration with BI tools enhancement New feature or request SQL
Projects
None yet
Development

No branches or pull requests

2 participants