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: dont expand bq pseudocolumns in optimizer star expansion #1826

Merged
merged 3 commits into from
Jun 26, 2023

Conversation

z3z1ma
Copy link
Contributor

@z3z1ma z3z1ma commented Jun 26, 2023

Bigquery has pseudocolumns for time ingestion partitioned tables. These pseudocolumns are _PARTITIONTIME and PARTITIONDATE. Both of these are reserved identifiers, furthermore neither are returned in * expansion by bigquery. So we should respect that during the optimizer's star expansion. To not do so would break a valid query (by adding reserved idents to the projection).

@z3z1ma
Copy link
Contributor Author

z3z1ma commented Jun 26, 2023

Should be good now @tobymao

has_pivoted_source was not a sufficient type guard for mypy FYI, so the guards are more explicit in 2 places. Cost should be practically nothing.

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