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

Parser fail in Bigquery partition with RANGE_BUCKET and GENERATE_ARRAY #183

Closed
lmarqueto opened this issue Jan 9, 2023 · 3 comments
Closed
Assignees

Comments

@lmarqueto
Copy link

lmarqueto commented Jan 9, 2023

Describe the bug
In the Bigquery if use RANGE_BUCKET with GENERATE_ARRAY in partition the parser fail

To Reproduce
This fail

CREATE TABLE data.test(
    field_a INT OPTIONS(description='some description')
)
PARTITION BY RANGE_BUCKET(field_a, GENERATE_ARRAY(10, 1000, 1));

This work

CREATE TABLE data.test(
   field_a INT OPTIONS(description='some description')
 )
 PARTITION BY RANGE_BUCKET(field_a, [1,2,3]]) ;

Expected behavior
Parser work in both cases

@xnuinside
Copy link
Owner

I think problem in that in partition by does not supported yet functions, only columns lists, I will add support for that @lmarqueto and again thanks for opening the issue!

@lmarqueto
Copy link
Author

lmarqueto commented Jan 10, 2023

I did some tests and with only one functions it's work fine, eg:

PARTITION BY DATE_TRUNC(field, MONTH)
PARTITION BY DATE(field)
PARTITION BY RANGE_BUCKET(field, [1,2,3]])

But if put a function inside a another function, the parser fail

@xnuinside
Copy link
Owner

Finally released support in version 1.3.0. Tests: https://github.com/xnuinside/simple-ddl-parser/blob/main/tests/dialects/test_bigquery.py#L881
Sorry for ignoring this issue too long
If will be needed anything else - feel free to open new issue

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