我正在使用新的Storage API從 Golang 將數(shù)據(jù)流式傳輸?shù)?bigquery 。我的 bigquery 表的架構(gòu)包含一個(gè) TIMESTAMP 字段,如下所示:bq mk -t mydataset.mytable name:string,lastseen:timestamp另外,我已經(jīng)定義了一個(gè)這樣的協(xié)議緩沖區(qū):message Row { string Name = 1; google.protobuf.Timestamp LastSeen = 3;}但是,當(dāng)我將此數(shù)據(jù)提交到 BigQuery 時(shí),我收到以下錯(cuò)誤:rpc error: code = InvalidArgument desc = The proto field mismatched with BigQuery field at tutorial_Row.LastSeen, the proto field type message, BigQuery field type TIMESTAMP似乎google.protobuf.Timestampprotobuf 與 bigquery 中的 TIMESTAMP 類(lèi)型不對(duì)應(yīng)。這是有道理的,因?yàn)?bigquery 文檔說(shuō) TIMESTAMP 包含時(shí)區(qū),但google.protobuf.Timestamp不包含時(shí)區(qū)。但是我應(yīng)該使用哪個(gè)協(xié)議緩沖區(qū)?
1 回答

陪伴而非守候
TA貢獻(xiàn)1757條經(jīng)驗(yàn) 獲得超8個(gè)贊
是的,后端沒(méi)有正確解碼原始時(shí)間戳消息。
最快的分辨率答案:發(fā)送 int64 類(lèi)型,填充為紀(jì)元微秒。
https://cloud.google.com/bigquery/docs/write-api#data_type_conversions
- 1 回答
- 0 關(guān)注
- 105 瀏覽
添加回答
舉報(bào)
0/150
提交
取消