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

[BigQuery] Support math operation together with array access #2260

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

[BigQuery] Support math operation together with array access #2260

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

Comments

@tobiasheldring
Copy link
Contributor

Describe the bug
Bigquery should support math operations together with array access eg. my_array[0] / 100. Now an error is received eg.

SyntaxError: Expected "#", "'", "(", ",", "--", ".", "/*", ";", "AS", "EXCEPT", "FOR", "FROM", "GROUP", "HAVING", "INTERSECT", "LIMIT", "ORDER", "QUALIFY", "SELECT", "UNION", "WHERE", "WINDOW", "WITH", "\"", "`", [ \t\n\r], [A-Za-z_], or end of input but "/" found.

Database Engine
BigQuery

To Reproduce
Add the following test case to BigQuery.spec,.js

   {
      title: 'math operation after array access',
      sql: ['SELECT my_array[0] / 100 FROM table1', 'SELECT my_array[0] / 100 FROM table1']
    }

I also tested this with Postgres parser where it seems to work fine

@tobiasheldring tobiasheldring changed the title BigQuery: Support math operation together with array access [BigQuery] Support math operation together with array access Dec 16, 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