-
Notifications
You must be signed in to change notification settings - Fork 305
Implement BigQuery Partition By statements using sqlglot #2722
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
base: devel
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for dlt-hub-docs canceled.
|
…-bigquery-partition-expressions-sqlglot
…ncPartition tests
…from bigquery_partition_specs
…tifier formatting
… and clause creation
from typing import Any, Dict, Type, TypeVar, Union, Literal | ||
|
||
# Constant to avoid magic strings | ||
PARTITION_SPEC_TYPE_KEY = "_dlt_partition_spec_type" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rudolfix if we remove the legacy ways to specify the partition expression, then we don't need this anymore.
@@ -213,7 +217,7 @@ def test_create_table_with_partition_and_cluster(gcp_client: BigQueryClient) -> | |||
sqlfluff.parse(sql, dialect="bigquery") | |||
# clustering must be the last | |||
assert sql.endswith("CLUSTER BY `col2`, `col5`") | |||
assert "PARTITION BY `col10`" in sql | |||
assert "PARTITION BY `col10`" in sql or "PARTITION BY col10" in sql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rudolfix do you prefer to just remove col10
? By default, sqlglot does not quote the column name if it is not needed e.g. names with space
Description
Imeplement
Implenent BigQuery Partition By statements using sqlglot
Related Issues
Additional Context