我在 Cloud BigQuery 中有一个表,但service.Tabledata.InsertAll调用确实将数据插入到嵌套字段中。
// works
jsonRow["name"] = bigquery.JsonValue("Name")
// doesn't work
jsonRow["geo_location.City.Names.en"] = bigquery.JsonValue("Irvine")
rows[index] = new(bigquery.TableDataInsertAllRequestRows)
rows[index].Json = jsonRow
insertRequest := &bigquery.TableDataInsertAllRequest{Rows: rows}
insertRequest.IgnoreUnknownValues = true
call := service.Tabledata.InsertAll(project, dataset, "analytics_events", insertRequest)
if res, err := call.Do(); err!=nil{
Log.Fatal("Unable to Insert to BigQuery ", err)
return err
}
一只名叫tom的猫
红颜莎娜
相关分类