0
votes

I have created one bgquery table with partition in date field and clustered in id field. I have used terraform to create the table. But when I try to insert data in the table , I am getting error as :

com.google.cloud.bigquery.BigQueryException: Incompatible table partitioning specification. Expects partitioning specification interval(type:day,field:forecast_start) clustering(customer_id), but input partitioning specification is interval(type:day,field:forecast_start)

Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request 17:00:01 { 17:00:01 "code" : 400, 17:00:01 "errors" : [ { 17:00:01 "domain" : "global", 17:00:01 "message" : "Incompatible table partitioning specification. Expects partitioning specification interval(type:day,field:forecast_start) clustering(customer_id), but input partitioning specification is interval(type:day,field:forecast_start)", 17:00:01 "reason" : "invalid" 17:00:01 } ], 17:00:01 "message" : "Incompatible table partitioning specification. Expects partitioning specification interval(type:day,field:forecast_start) clustering(customer_id), but input partitioning specification is interval(type:day,field:forecast_start)", 17:00:01 "status" : "INVALID_ARGUMENT"

Any suggestion?

1
This doesn't look like an error at insertion time. More context from the error log or code? - Felipe Hoffa
I am doing BQ to BQ load using BQ api.Here is the log :17:00:01 com.google.cloud.bigquery.BigQueryException: Incompatible table partitioning specification. Expects partitioning specification interval(type:day,field:forecast_start) clustering(customer_id), but input partitioning specification is interval(type:day,field:forecast_start) 17:00:01 at com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc.translate(HttpBigQueryRpc.java:99) 17:00:01 at com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc.getQueryResults(HttpBigQueryRpc.java:401) 17:00:01 at - Prithwiraj Samanta
Add more context please. Log? code? - Felipe Hoffa
Interestingly if I copy data using bq command from one table to other it is working fine. But if I try using api , I am getting the error - Prithwiraj Samanta
Looks like you specified the partitioning field but not the clustering field in your query job. You can either specify both, or none. If you specify it, BQ will use it to create the destination table if it doesn't exist; if the destination table exists, BQ will check it matches the destination table. - Hua Zhang

1 Answers

0
votes

Looks like you specified the partitioning field but not the clustering field in your query job. You can either specify both, or none. If you specify it, BQ will use it to create the destination table if it doesn't exist; if the destination table exists, BQ will check it matches the destination table.

Posted on behalf of @HuaZhang