Mül*_*ler 2 python apache-beam
当尝试运行此管道时,我收到此异常:
Exception has occurred: AttributeError module 'apache_beam.io.gcp.internal.clients.bigquery' has no attribute 'TableReference'
table_spec='ExporterPlayGround.TEST_STREAM'
with beam.Pipeline(options=pipeline_options) as p:
from apache_beam.io.gcp.internal.clients import bigquery
raw_stream = (
p | 'Start subscriber' >> beam.io.gcp.pubsub.ReadFromPubSub(subscription=subscription_name)
| 'Write to Table' >> beam.io.WriteToBigQuery(
table_spec,
schema='test_float:FLOAT, test2_float:FLOAT',
write_disposition=beam.io.BigQueryDisposition.WRITE_APPEND,
create_disposition=beam.io.BigQueryDisposition.CREATE_IF_NEEDED)
)
Run Code Online (Sandbox Code Playgroud)
也许我错过了一些明显的东西,但我似乎看不出问题是什么,我正在提供文档指向的参考 bigquery。
我最终解决了这个问题,我的错误。我安装了错误的软件包。pip install apache-beam不包括 GCP 支持。我不得不使用pip install apache-beam[gcp]
| 归档时间: |
|
| 查看次数: |
1589 次 |
| 最近记录: |