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

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

Open
bnaul opened this issue Apr 5, 2024 · 0 comments · May be fixed by #1057
Open

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

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

Comments

@bnaul
Copy link

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 bnaul linked a pull request Apr 5, 2024 that will close this issue
bnaul added a commit to replicahq/pybigquery that referenced this issue Apr 5, 2024
@chalmerlowe chalmerlowe self-assigned this Apr 8, 2024
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
Development

Successfully merging a pull request may close this issue.

2 participants