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

[Redshift] Support double casting inside function #2261

Open
tobiasheldring opened this issue Dec 16, 2024 · 0 comments
Open

[Redshift] Support double casting inside function #2261

tobiasheldring opened this issue Dec 16, 2024 · 0 comments
Assignees

Comments

@tobiasheldring
Copy link
Contributor

Describe the bug
Double cast parses fine, but not inside a function eg. a COUNT. then it gives the error below

 SyntaxError: Expected "!=", "!~", "!~*", "#-", "#>", "#>>", "%", "&&", "(", ")", "*", "+", ",", "-", "--", "->", "->>", "/", "/*", "<", "<=", "<>", "<@", "=", ">", ">=", "?", "?&", "?|", "@>", "AND", "AS", "BETWEEN", "ILIKE", "IN", "IS", "LIKE", "NOT", "OR", "ORDER", "SIMILAR", "\"", "||", "~", "~*", [ \t\n\r], or [A-Za-z_一-龥] but ":" found.

Database Engine
Redshift

To Reproduce
Add the following test case to redshift.spec.js

it('should support double cast inside count', () => {
    const sql = "SELECT COUNT(DISTINCT event_time::DATE::TEXT || '_' || event_type) FROM my_events"
    expect(getParsedSql(sql)).to.be.equal("SELECT COUNT(DISTINCT event_time::DATE::TEXT || '_' || event_type) FROM my_events")
  })
@tobiasheldring tobiasheldring changed the title [Redshift] Support double casting inside statement [Redshift] Support double casting inside function Dec 17, 2024
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

2 participants