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: Spanner generate-partition to use BQ dialect #1066

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

nehanene15
Copy link
Collaborator

Closes #1059

The ibis.to_sql() method (code here) defaults the sqlglot_dialect as backend.name unless passed in as a parameter. Since Spanner isn't supported by sqlglot, this PR passes in BigQuery as the dialect since they have interchangeable SQL syntax.

@nehanene15 nehanene15 requested a review from a team as a code owner December 4, 2023 20:30
@nehanene15
Copy link
Collaborator Author

/gcbrun

Copy link
Contributor

Choose a reason for hiding this comment

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

Neha,

Thanks. This looks good to me. I could not track down the source of to_sql myself. You can find the backend from the ibis table expression, there is a method called _find_backend(). The dry run code could use ibis.to_sql(query) instead of checking if the backend is SQLAlchemy or a SQL backend and doing different actions. Some ideas after a lot of code exploration.

Sundar Mudupalli

@nehanene15 nehanene15 merged commit f3cc565 into develop Dec 5, 2023
5 checks passed
@nehanene15 nehanene15 deleted the issue1059-spanner-partitions branch December 5, 2023 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

generate-table-partitions fails for Spanner with Unknown dialect spanner
2 participants