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

parsing a bigquery statement not recognising project_id when backtick separates the project #3083

Closed
razvan-am opened this issue Mar 5, 2024 · 3 comments
Assignees

Comments

@razvan-am
Copy link

Bigquery has many distinct types of marking tables/objects.
In one of the cases it can handle: `project`.`dataset.table` sql_glot doesn't seem to be able to identify the project.

Fully reproducible code snippet

my_str = 'SELECT * FROM `project_id`.`dataset_id.table_id`'

parsed_string = sqlglot.parse(my_str, dialect='bigquery')

print(repr(parsed_string))

Output

[Select(
  expressions=[
    Star()],
  from=From(
    this=Table(
      this=Identifier(this=table_id, quoted=True),
      db=Identifier(this=dataset_id, quoted=True))))]
@tobymao
Copy link
Owner

tobymao commented Mar 5, 2024

hi @razvan-am do you have documentation for this or could you show us a screen shot that this is legal syntax?

@razvan-am
Copy link
Author

image

@razvan-am
Copy link
Author

If I'll stumble upon the documentation, I'll share it here.

we've had many issues due to the many ways that bigquery accetps the syntax. I have many tests and i'll share as I go through them.

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