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

Are we really parsing CREATE statement the right way? #52

Closed
zeninpalm opened this issue Nov 5, 2021 · 2 comments
Closed

Are we really parsing CREATE statement the right way? #52

zeninpalm opened this issue Nov 5, 2021 · 2 comments

Comments

@zeninpalm
Copy link
Contributor

Hi Toby,

I'm trying to parse "CREATE OR REPLACE TEMPORARY VIEW ...", but I noticed that in generator.py, you wrote CREATE{temporary}{replace}. I think that's a typo because then the generated SQL will be "CREATE TEMPORARY OR REPLACE ...".

And in parser.py, you wrote

def _parse_create(self):
    temporary = self._match(TokenType.TEMPORARY)
    replace = self._match(TokenType.OR) and self._match(TokenType.REPLACE)

I guess it should be

def _parse_create(self):
    replace = self._match(TokenType.OR) and self._match(TokenType.REPLACE)
    temporary = self._match(TokenType.TEMPORARY)

Please let me if I understand your code correctly 😄

@tobymao tobymao closed this as completed in 6dbfeb5 Nov 5, 2021
@tobymao
Copy link
Owner

tobymao commented Nov 5, 2021

thanks for the report, fixed

@zeninpalm
Copy link
Contributor Author

Great @tobymao

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