Skip to content

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

Closed
@bnaul

Description

@bnaul

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.

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the googleapis/python-bigquery-sqlalchemy API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions