Skip to content

Time partitioning on DATE column fails with type_="DAY" #1056

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

Closed
bnaul opened this issue Apr 5, 2024 · 0 comments · Fixed by #1074
Closed

Time partitioning on DATE column fails with type_="DAY" #1056

bnaul opened this issue Apr 5, 2024 · 0 comments · Fixed by #1074
Assignees
Labels
api: bigquery Issues related to the googleapis/python-bigquery-sqlalchemy API.

Comments

@bnaul
Copy link
Contributor

bnaul commented Apr 5, 2024

Changing field="timestamp_c" to field="date_c" in test_create_table (

) gives the following error:

DatabaseError: (google.cloud.bigquery.dbapi.exceptions.DatabaseError) 400 

PARTITION BY expression must be

_PARTITIONDATE,
DATE(_PARTITIONTIME),
DATE(<timestamp_column>),
DATE(<datetime_column>),
DATETIME_TRUNC(<datetime_column>, DAY/HOUR/MONTH/YEAR),
a DATE column,
TIMESTAMP_TRUNC(<timestamp_column>, DAY/HOUR/MONTH/YEAR),
DATE_TRUNC(<date_column>, MONTH/YEAR),
or RANGE_BUCKET(<int64_column>, GENERATE_ARRAY(<int64_value>, <int64_value>[, <int64_value>]))

Passing e.g. type_="MONTH" works since that's a supported partitioning function.

@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery-sqlalchemy API. label Apr 5, 2024
bnaul added a commit to replicahq/pybigquery that referenced this issue Apr 5, 2024
@chalmerlowe chalmerlowe self-assigned this Apr 8, 2024
bnaul added a commit to replicahq/pybigquery that referenced this issue May 9, 2024
bnaul added a commit to replicahq/pybigquery that referenced this issue May 9, 2024
bnaul added a commit to bnaul/python-bigquery-sqlalchemy that referenced this issue May 13, 2024
Fixes googleapis#1056.

Co-authored-by: Chalmer Lowe <chalmerlowe@google.com>
chalmerlowe added a commit that referenced this issue May 13, 2024
Fixes #1056.

Co-authored-by: Chalmer Lowe <chalmerlowe@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-sqlalchemy API.
Projects
None yet
2 participants