python - BigQuery SQL 作业对 Dataflow 管道的依赖性
问题描述
我在 python 中有一个 apache 光束管道,无论出于何种原因,它都有如下所示的流程。
client = bigquery.Client()
query_job1 = client.query('create table sample_table_1 as select * from table_1')
result1 = query_job.result()
with beam.Pipeline(options=options) as p:
records = (
p
| 'Data pull' >> beam.io.Read(beam.io.BigQuerySource(...))
| 'Transform' >> ....
| 'Write to BQ' >> beam.io.WriteToBigQuery(...)
)
query_job2 = client.query('create table sample_table_2 as select * from table_2')
result2 = query_job2.result()
SQL 作业 --> 数据管道 --> SQL 作业
当我在本地运行此序列时,此序列工作正常。但是,当我尝试将其作为 Dataflow 管道运行时,它并没有真正按此顺序运行。
有没有办法在数据流上运行时强制依赖?
解决方案
正如@PeterKim 提到的,您在评论部分描述的处理流程仅使用Dataflow 是不可能实现的。目前,Dataflow 编程模型不支持它。
您可以使用 Composer 来编排相互依赖的顺序作业执行,请点击此处。
推荐阅读
- swift - 如何通过仅查看标签栏图标使标签栏背景透明?
- excel - 如何使用按钮启动操作?
- oop - c ++如何从指向派生类对象的基类指针访问派生类自定义unordered_map而不使用强制转换
- django - 如何加入这些 Django 模型?
- php - 带有附件的PHP邮件()函数不起作用
- java - 填充我的 AVLTree 需要很长时间
- python - Scipy.optimize.minimize 没有给出最小值,即使它看到了最小值
- reactjs - Redux 表单字段数组无法显示纯文本值
- angular - mat-list 按同一类别排列,标题应该出现一次
- android - 在三星 S8 中安装 Sign Apk 时出现白屏