Write pubsub data to gcs through dataflow

馋奶兔 提交于 2019-12-24 20:47:51

问题


I would like to consume data from pubsub through dataflow streaming job and store it into GCS in hourly directories.

What would be best approach?

I tried using WindowedFilenamePolicy but it adds an additional group by and slows down the write operation at the time of writes. Dataflow buffers the data correctly but takes too long to write data in temp bucket.

Any best practice for such fairly common case?

Regards, Pari


回答1:


Using the Google-Provided Dataflow Template for the streaming pipeline from Cloud Pub/Sub to Google Cloud Storage files, you can easily do it by setting the outputDirectory to gs://<BUCKET>/YYYY/MM/DD/HH/ and it will automatically replace YYYY, MM, DD and HH for the values of the interval window.



来源:https://stackoverflow.com/questions/52217005/write-pubsub-data-to-gcs-through-dataflow

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