0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

@google-cloud/bigquery-storage において managedwriter.JSONWriter に TIMESTAMP 型を appendRows するには Date 型が必要

Posted at

検索しても情報が引っかからず少し苦労したので忘備録

Node.js で @google-cloud/bigquery-storage を使ってデータを送る場合、managedwriter.JSONWriter を appendRows するかと思われる。

具体的には、以下の例のようなイメージである。
https://docs.cloud.google.com/bigquery/docs/write-api-streaming?hl=ja#node.js

この時に、必ず interior hyphen となってしまった。

調査した結果、proto の関係でハイフンが識別子やら何かに含まれるからエラーとなっているぽいことはわかったが、それ以上のことがまるっきりわからなかった。

いろいろ試したところ、TIMESTAMP 型として定義している項目を文字列とした object を appendRows で送ろうとすることで発生していた。

回避するためには、Date型とした object を渡せば良い。
以上

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?