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: have table exclude this if schema target #2921

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

eakmanrq
Copy link
Collaborator

@eakmanrq eakmanrq commented Feb 6, 2024

Prior to this change table objects which were the target of CREATE SCHEMA or DROP SCHEMA would set this as the db name and then db as the catalog name (if provided). The rendered SQL is fine but if we call something like qualify_table on the expression and try to set a catalog if one does not exist then it will add the catalog when it is not needed since it will see the catalog filed as None when really catalog is set but it is just set in the db field.

sqlglot/parser.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@georgesittas georgesittas left a comment

Choose a reason for hiding this comment

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

Looks good, agree with Toby's comments

@tobymao tobymao merged commit d20d826 into main Feb 6, 2024
5 checks passed
@tobymao tobymao deleted the eakmanrq/fix_schema_parsing branch February 6, 2024 17:22
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.

None yet

3 participants