I am using golang bigquery client to insert data into bigquery.
Below is a part of my code.
ctx := context.Background()
client, err := bigquery.NewClient(ctx, "project_id", option.WithCredentialsFile("google-credentials.json"))
if err != nil {
panic(err.Error())
}
Inserter = client.Dataset("data-set").Table("table_name").Inserter()
if err := Inserter.Put(ctx, body); err != nil {
if pmErr, ok := err.(bigquery.PutMultiError); ok {
for _, rowInsertionError := range pmErr {
log.Println(rowInsertionError.Errors)
}
}
return nil, err
}
And I get error without location and message.
2022/03/25 10:03:13 {Location: ""; Message: ""; Reason: "invalid"}
2022/03/25 10:03:13 {Location: ""; Message: ""; Reason: "invalid"}
2022/03/25 10:03:13 {Location: ""; Message: ""; Reason: "invalid"}
2022/03/25 10:03:13 {Location: ""; Message: ""; Reason: "invalid"}
I believe I am doing something wrong. But can't seem to find where to look at from those error messages.
What is the cause of bigquery error without location and message.
Thank you in advance.