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

Support for CAST() function #225

Closed
rupal-bq opened this issue Oct 18, 2019 · 3 comments
Closed

Support for CAST() function #225

rupal-bq opened this issue Oct 18, 2019 · 3 comments
Assignees
Labels
BI integration Issues for integration with BI tools bug Something isn't working good first issue Good for newcomers

Comments

@rupal-bq
Copy link
Contributor

rupal-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

Query: SELECT cast(dayOfWeek AS FLOAT) AS calculation FROM kibana_sample_data_flights

Result: No data

{[\n]"
  "error": {[\n]"
    "reason": "Invalid SQL query",[\n]"
    "details": "Failed to parse query due to offending symbol [AS] at: 'SELECT cast(dayOfWeek AS' <--- HERE... More details: Expecting tokens in {'SELECT', '('}",[\n]"
    "type": "SyntaxAnalysisException"[\n]"
  },[\n]"
  "status": 400[\n]"
}

Expected Behaviour: Should return all values from column dayOfWeek as float.

@dai-chen
Copy link
Member

We removed CAST syntax in new parser grammar because we thought we don't support it. Actually there are UTs in codebase however UT won't run with new parser. Need to add it back.

@dai-chen
Copy link
Member

Apart from the changes in grammar, need to add ITs to cover this case.

@dai-chen dai-chen added BI integration Issues for integration with BI tools bug Something isn't working good first issue Good for newcomers labels Oct 18, 2019
@davidcui1225 davidcui1225 self-assigned this Oct 22, 2019
@dai-chen
Copy link
Member

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 bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants