我正在从查找中读取一些客户记录并将其写入bigquery表中,然后从同一表中读取一些必需的数据字段,并尝试使用批处理模式下的数据流管道将该数据(Json(作为消息推送到pubsub。但是收到错误:"ValueError:Cloud Pub/Sub 当前只能在流管道中使用"。
delete_rows = p | 'reading data to be deleted' >> beam.io.Read(
beam.io.BigQuerySource(
query=delete_query,
use_standard_sql=True))
required_data = delete_rows | 'Retriving only required data' >> beam.ParDo(RequiredData())
push_to_pubsub = required_data | 'Pushing data to pubsub' >> beam.io.WriteToPubSub(
topic='my topic name',
with_attributes=False,
id_label=None,
timestamp_attribute=None
)
我想在数据流管道的批处理模式下使用 PubSub
感谢您尝试这个。Cloud Pub/Sub for Dataflow Python SDK 目前作为数据流原生源实现,仅适用于 Dataflow Python 流式后端。我们可以考虑在未来提供适用于批处理管道的实现,但我没有 ETA。