Skip to content

Conversation

@r1b
Copy link

@r1b r1b commented Sep 1, 2025

Description of changes

Besides a column name, BigQuery also allows a small set of partition expressions in the PARTITION BY clause. This PR adds support for these expressions by directly parsing the partition_by kwarg into its corresponding sqlglot construct.

The BigQuery backend does not advertise support for accepting a list in the partition_by kwarg in its type signature or otherwise in the docs. However, the previous implementation made it so that passing a list was the only way to populate the PARTITION BY clause. Because BigQuery does not currently accept more than one partition expression, I did not update the interface to allow lists, but note that it looks like some users are doing this as a workaround (see discussion on #10022).

I added two unit tests for two sample partition expressions.

Issues closed

@github-actions github-actions bot added tests Issues or PRs related to tests bigquery The BigQuery backend labels Sep 1, 2025
@r1b r1b force-pushed the fix/bigquery-partition-by branch from e462861 to 83f47fb Compare September 1, 2025 19:47
@r1b r1b force-pushed the fix/bigquery-partition-by branch from 83f47fb to a035c08 Compare September 1, 2025 20:00
@r1b
Copy link
Author

r1b commented Sep 3, 2025

For CI checks -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bigquery The BigQuery backend tests Issues or PRs related to tests

Projects

None yet

1 participant