bigquery-emulator
bigquery-emulator copied to clipboard
CREATE TABLE with PARTITION BY is unsupported
Any attempt to create a table with a partition column[s] specified produces this error.
For example:
CREATE TABLE test_events_date (ID date) PARTITION BY ID
Result:
BigQuery error in query operation: Error processing job 'test:bqjob_r3d26e65599bb2335_000001867f166412_1': failed to analyze: INVALID_ARGUMENT: CREATE TABLE with PARTITION BY is unsupported [at 1:41]
PS: used docker image ghcr.io/goccy/bigquery-emulator:0.2.13
It seems that any feature related to PARTITIONED TABLES
has issues, such as the _PARTITIONTIME
pseudo column.
Encounter something similar googleapi: Error 400: failed to analyze: INVALID_ARGUMENT: Unrecognized name: _PARTITIONTIME [at 44:23], jobInternalError
The same is true for me. Are there any updates on this issue ?
At the moment, I can create a partitioned table using the client libraries. At least, I won't get an error (what already helps in tests and local emulation!). The emulator, however, accepts queries that would not work with BigQuery for the schema.
Here's an example. Given the following table definition
{
"type": "TABLE",
"schema": {
"fields": [
{
"mode": "REQUIRED",
"name": "value",
"type": "DATE"
}
]
},
"timePartitioning": {
"field": "value",
"type": "DAY",
"expirationMs": 315569260000,
"requirePartitionFilter": true
}
}
BigQuery would reject a query that does not contain the value
field within its' WHERE
clause, where the emulator accepts such a query.
I guess it is a lot of work to support all the partitioning features of BigQuery, but I could imagine that it's easier to check if the query is valid according to requirePartitionFilter
fields of the schema. This would at least help to ensure that queries are well formed. Would this be a first step into the direction of better partitioning support ?
Are there any updates on this topic ?