[英]Issue with reading millions of files from cloud storage using dataflow in Google cloud
場景:我正在嘗試讀取文件並將數據發送到 pub/sub
數百萬個文件存儲在雲存儲文件夾 (GCP) 中
我使用來自 pub/sub 主題的模板“雲存儲上的文本文件到 Pub/Sub”創建了一個數據流管道
但是上面的模板無法讀取數百萬個文件並失敗並出現以下錯誤
java.lang.IllegalArgumentException: Total size of the BoundedSource objects generated by split() operation is larger than the allowable limit. When splitting gs://filelocation/data/*.json into bundles of 28401539859 bytes it generated 2397802 BoundedSource objects with total serialized size of 199603686 bytes which is larger than the limit 20971520.
系統配置: Apache 光束:2.38 Java SDK 機器:高性能n1-highmem-16
關於如何解決這個問題的任何想法? 提前致謝
根據本文檔 (1),您可以通過修改自定義BoundedSource
子類來解決此問題,以便生成的BoundedSource
對象變得小於 20 MB 限制。
(1) https://cloud.google.com/dataflow/docs/guides/common-errors#boundedsource-objects-splitintobundles
您還可以使用TextIO.readAll()來避免這些限制。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.