Google Dataflow: running dynamic query with BigQuery+Pub/Sub in Python

一世执手 提交于 2019-12-03 21:51:46

You can read the whole table or use a string query.

I understand that you will use the parse_methodBQ method to customize the query as needed. As this method returns a query, you can call it with BigQuerySource. The rows are in dictionary.

| 'QueryTable' >> beam.Map(beam.io.BigQuerySource(parse_methodBQ))
# Each row is a dictionary where the keys are the BigQuery columns
| 'Read' >> beam.Map(lambda s:  s['data'])

Further more, you can avoid having to customize the query and use a filter method

Regarding the side inputs, review this example from the cookbook to have a better view on how to use them.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!