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

sqlglot incompatibilites with INFORMATION_SCHEMA identifiers #6655

Open
scholtzan opened this issue Dec 11, 2024 · 0 comments
Open

sqlglot incompatibilites with INFORMATION_SCHEMA identifiers #6655

scholtzan opened this issue Dec 11, 2024 · 0 comments

Comments

@scholtzan
Copy link
Collaborator

scholtzan commented Dec 11, 2024

A recent update to sqlglot results in INFORMATION_SCHEMA table identifiers being parsed differently. The INFORMATION_SCHEMA part is now always quoted and parts are interpreted differently. This messes with some of our substitution logic in

# but information_schema region may also be parsed as catalog
if table_expr.catalog.startswith("region-"):
project_name = f"{target_project}.{table_expr.catalog}"
elif table_expr.catalog == "": # no project id
project_name = target_project
else: # project id exists
continue
# fully qualified table ref
replacement_string = f"`{project_name}.{table_expr.db or default_dataset}.{table_expr.name}`"
table_replacements.add((reference_string, replacement_string))

The sqlglot change that caused this: tobymao/sqlglot@84f78aa#diff-3cdd876ac935bf47c0213f4f49aac3319401a3f4d0012d58d716d9c814a6e2faR609

We should try updating this logic so we can update to the most recent sqlglot version

┆Issue is synchronized with this Jira Task

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

1 participant