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

BigQuery Fixes #924

Merged
merged 6 commits into from
Jan 12, 2023
Merged

BigQuery Fixes #924

merged 6 commits into from
Jan 12, 2023

Conversation

eakmanrq
Copy link
Collaborator

Main changes:

  1. BigQuery does not allow precision on parameterized types when doing casts. Therefore added a transformer to remove these when casts are detected.
  2. When doing an UNNEST(... (similar to VALUES but for BigQuery) BigQuery auto detects types from the first row of values. If one of those values are a null then it will potentially select the wrong type. Therefore updated values to accept column names and types and if types are provided then the first row is casted to the desired type to make sure type inference works correctly.

@eakmanrq eakmanrq requested a review from tobymao January 12, 2023 21:38
sqlglot/expressions.py Outdated Show resolved Hide resolved
sqlglot/transforms.py Outdated Show resolved Hide resolved
@eakmanrq eakmanrq requested a review from tobymao January 12, 2023 22:04
@tobymao tobymao merged commit b469cb0 into main Jan 12, 2023
@tobymao tobymao deleted the eakmanrq/bq_fixes branch January 12, 2023 22:13
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.

2 participants