如何将谷歌数据流字数输出保存到大查询表中?

问题描述 投票:0回答:1

我正在执行数据流字数统计实验,但结束后我想将输出存储到云存储中的谷歌大查询中。 实验——https://cloud.google.com/dataflow/docs/sample-template 我使用以下语法将输出存储到云存储中

python3 -m apache_beam.examples.wordcount --region us-central1 --input gs://example/shak/doc.txt --output gs://example/result/output --runner DataflowRunner --project 项目名称 - -temp_location gs://example/temp

google-cloud-dataflow
1个回答
0
投票

您可以使用 WriteToBigQuery PTransform 作为接收器来写入输出数据。

有关如何执行此操作的简单示例 - https://github.com/apache/beam/blob/2ad459113134dfffd3caeeb15e821bb644e08663/sdks/python/apache_beam/examples/cookbook/bigquery_tornadoes.py#L98

© www.soinside.com 2019 - 2024. All rights reserved.