fix(bigquery): support expression in partition_by #11593
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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_bykwarg into its corresponding sqlglot construct.The BigQuery backend does not advertise support for accepting a list in the
partition_bykwarg 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
partition_byparameter #11526