小编Mül*_*ler的帖子

尝试写入 BigQuery 时 Apache Beam 中没有属性“TableReference”

当尝试运行此管道时,我收到此异常:

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。

python apache-beam

2
推荐指数
1
解决办法
1589
查看次数

标签 统计

apache-beam ×1

python ×1