Closed2
Stream Firestore to BigQuery
FirestoreのドキュメントをBigQueryにストリームするためのExntention。
BQにエクスポートされたデータを整形したい
- エクスポートされたデータはそのままだと利用しずらい。
- https://github.com/firebase/extensions/blob/master/firestore-bigquery-export/guides/GENERATE_SCHEMA_VIEWS.md
- JSONで定義したschemaを作成。そのJSONに基づいたViewを作成してくれる。
スキーマ
{
"fields": [
{
"name": "type",
"type": "string"
},
{
"name": "scheduledDateTime",
"type": "timestamp"
}
]
}
コマンド
npx @firebaseextensions/fs-bq-schema-views \
--non-interactive \
--project={projectId} \
--dataset={データセット名} \
--table-name-prefix={テーブル名} \
--schema-files=./test_schema.json
- ドキュメントには
--big-query-project=
を指定しろ、と書いてあるが実際に指定してコマンドを実行するとerror: unknown option '--big-query-project=...'
というエラーが返ってくる。
Extentionsを設定した以前のデータをインポートしたい
npx @firebaseextensions/fs-bq-import-collection \
--non-interactive \
--project={projectId} \
--big-query-project={projectId} \
--source-collection-path=messageHistory \
--dataset=source__firestore__export \
--table-name-prefix=messageHistory \
--batch-size=300 \
--dataset-location=asia-northeast1 \
--multi-threaded=false \
--query-collection-group=true
このスクラップは4日前にクローズされました