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

Fix(oracle): set post_tablesample_alias=True to fix alias parsing #1548

Merged
merged 2 commits into from
May 4, 2023

Conversation

georgesittas
Copy link
Collaborator

Fixes #1541

@@ -426,29 +426,18 @@ def test_null_treatment(self):
def test_sample(self):
Copy link
Collaborator Author

@georgesittas georgesittas May 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We used to convert SAMPLE to TABLESAMPLE, which are synonymous in Snowflake:

SAMPLE and TABLESAMPLE are synonymous and can be used interchangeably.

With the change in the parser related to kind (see _parse_table_sample), we now actually use whatever the token's text was, so I adapted these tests accordingly.

@georgesittas georgesittas force-pushed the jo/oracle_tablesample branch from cb0c982 to e1d791e Compare May 4, 2023 16:38
@georgesittas georgesittas merged commit f21abb7 into main May 4, 2023
@georgesittas georgesittas deleted the jo/oracle_tablesample branch May 4, 2023 16:41
adrianisk pushed a commit to adrianisk/sqlglot that referenced this pull request Jun 21, 2023
…bymao#1548)

* Fix(oracle): set post_tablesample_alias=True to fix alias parsing

* Fixups
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

Successfully merging this pull request may close these issues.

Alias to SAMPLE(CLAUSE) throw ParseError for Oracle dialect
2 participants