【问题标题】:Copy Firestore Database Data to Bigquery using Cloud Shell Terminal使用 Cloud Shell 终端将 Firestore 数据库数据复制到 Bigquery
【发布时间】:2021-12-05 01:55:54
【问题描述】:

有谁知道如何使用 Cloud Shell 终端手动将数据从 Firestore 数据库复制/传输到 Bigquery?

我过去曾这样做过,但找不到我使用的文档/视频。我发现很多说明一旦 Bigquery 连接到 Firebase,它应该是自动的,但我的不是。

当我在 Cloud Shell 终端中运行代码以从 Firebase 提取数据时,该集合作为表复制到 Bigquery 数据集中。创建了两个表,并创建了“raw_latest”和“raw_changelog”。

我现在不知道如何转移另一个收藏。 我特别需要从 Firestore 数据库中的子集合传输数据。

【问题讨论】:

  • 嘿用户78286。你在这方面有什么进展吗?我试图在下面提供答案。你有没有机会检查一下,这有意义吗?如果我的回答有用,请点击它左侧的点赞按钮 (▲)。如果它回答了您的问题,请单击复选标记 (✓) 接受它。这样其他人就知道你得到了(足够的)帮助

标签: firebase google-cloud-firestore google-bigquery google-cloud-shell google-cloud-shell-editor


【解决方案1】:
  1. 您现在可以使用 Firebase 扩展。要导入您需要的所有以前的数据 首先安装扩展,因为所有的写入同时做 不安装扩展先导出会丢失。

    见:https://firebase.google.com/products/extensions/firestore-bigquery-export

  2. Firestore 允许使用 GCS 将数据导入/导出到 BigQuery 桶。数据将导出到 Cloud Storage 存储分区并从 在那里可以将其导入 Big Query。
    相同的 gcloud 命令是:

导出数据:

gcloud beta firestore export --collection-ids=users gs://my bucket/users

将备份加载到 bq 中:

bq load --source_format=DATASTORE_BACKUP mydataset.users gs://gs://mybucket/users/all_namespaces/kind_users/all_namespaces_kind_users.export_metadata
  1. 以下是一些可能有用的链接:

【讨论】:

    猜你喜欢
    • 2022-12-13
    • 2020-10-03
    • 2020-12-31
    • 2019-07-05
    • 2021-06-07
    • 2021-08-08
    • 2019-05-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多