有没有办法将 avro 模式与 Bigquery 和 Bigtable 相匹配?

Is there a way to match avro schema with Bigquery and Bigtable?

我想使用 Google Composer 将 bigquery 数据导入 bigtable。

已成功将 Avro 格式的 bigquery 行导出到 GCS。然而,将Avro数据导入Bigtable却不行。

错误说

Caused by: org.apache.avro.AvroTypeException: Found Root, expecting com.google.cloud.teleport.bigtable.BigtableRow, missing required field key

我想 bigquery 和 bigtable 之间的模式应该相互匹配。但是我不知道该怎么做。

对于从 Avro 文件中读取的每条记录:

  • 文件和 table 中存在的属性被加载到 table。
  • 文件中存在但 table 中没有的属性受 ignore_unknown_fields、
  • 的约束
  • 存在于 table 而文件中不存在的属性将使用它们的默认值,如果有一组的话。

以下链接很有用。

[1] https://cloud.google.com/dataflow/docs/guides/templates/provided-batch#cloud-storage-avro-to-bigtable [2] https://github.com/GoogleCloudPlatform/DataflowTemplates/blob/master/src/main/resources/schema/avro/bigtable.avsc

[3]