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 BigQuery hyphenated ObjectName with numbers #1598

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ayman-sigma
Copy link
Contributor

We currently support hyphenated identifiers for BigQuery. The current code expects the number segment to be the last segment ex: foo-123 and should be followed by whitespace. That is true except when this identifier is part of an ObjectName. Ex: SELECT * FROM foo-123.bar.
The issue is that tokenizer parse the previous string as: [Word("foo"), Minus, Number("123."), Word("bar")]
This PR:

  1. Fixes the tokenizer to tokenize foo-123.bar as [Word('"foo"), Minus, Number("123"), Period, Word("bar")]
  2. Fixes the parser to parse foo-123.bar as ObjectName([Ident("foo-123"), Ident("bar")]) instead of erroring out.

@ayman-sigma
Copy link
Contributor Author

I think I messed up something while fixing clippy. I will fix.

@ayman-sigma ayman-sigma force-pushed the ayman/fixBigqueryHyphenatedObjectName branch from acd682e to 0c01b33 Compare December 12, 2024 20:35
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.

1 participant