Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CAST throw ParseError for Oracle dialect #1543

Closed
Pizzi95 opened this issue May 4, 2023 · 2 comments
Closed

CAST throw ParseError for Oracle dialect #1543

Pizzi95 opened this issue May 4, 2023 · 2 comments
Assignees

Comments

@Pizzi95
Copy link

Pizzi95 commented May 4, 2023

It seems that in oracle dialect it does not recogniye BINARZ_DOUBLE as a type and thow a ParseError.
If you try to parse the statement below it returns an Invalid expression / unexpected token error
sql_query = "SELECT CAST(SUM(t0.column_name) AS BINARY_DOUBLE) FROM t0"
parsed = parse_one(sql_query , read='oracle')

Retrieved Error
image

More info about CAST in Oracle here: Oracle Docs

@georgesittas
Copy link
Collaborator

Can BINARY_FLOAT and BINARY_DOUBLE be mapped back to FLOAT and DOUBLE?

@Pizzi95
Copy link
Author

Pizzi95 commented May 4, 2023

Based on Oracle documentation it seems so, never tried

@tobymao tobymao self-assigned this May 4, 2023
@tobymao tobymao closed this as completed in 8ebba48 May 4, 2023
adrianisk pushed a commit to adrianisk/sqlglot that referenced this issue Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants