【发布时间】:2016-07-19 02:08:28
【问题描述】:
我在 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
}
【问题讨论】:
标签: go google-bigquery