简体   繁体   English

Apache Beam BigqueryIO.Write getSuccessfulInserts 不工作

[英]Apache Beam BigqueryIO.Write getSuccessfulInserts not working

We are creating a simple apache beam pipeline which inserts data into a bigquery table and We are trying to get the tableRows which have been successfully Inserted into the table and tableRows which are errored, the code is as shown in the screenshot我们正在创建一个简单的 apache 光束管道,它将数据插入到一个 bigquery 表中,我们正在尝试获取已成功插入到表中的 tableRows 和出错的 tableRows,代码如屏幕截图所示

流水线代码

According to the following documentation: https://beam.apache.org/releases/javadoc/2.33.0/org/apache/beam/sdk/io/gcp/bigquery/WriteResult.html BigQueryIO.writeTableRows() returns a WriteResult object which has getSuccessfulInserts() which will return a PCollection<TableRow> which contains the TableRows that have been successfully inserted and getFailedInserts() will return another PCollection<TableRow> which contains the TableRows that have been failed.根据以下文档: https://beam.apache.org/releases/javadoc/2.33.0/org/apache/beam/sdk/io/gcp/bigquery/WriteResult.html BigQueryIO.writeTableRows()返回WriteResult object其中有getSuccessfulInserts() ,它将返回一个PCollection<TableRow> ,其中包含已成功插入的TableRowsgetFailedInserts()将返回另一个PCollection<TableRow> ,其中包含已失败的TableRows

But when we are testing the pipeline getFailedInserts() seems to be working, it is getting the TableRows which are failed, but getSuccessfulInserts() is always getting an empty PCollection we have tried everything but it doesn't seem to work.但是当我们测试管道getFailedInserts()似乎工作时,它正在获取失败的TableRows ,但是getSuccessfulInserts()总是得到一个空的PCollection我们已经尝试了一切但它似乎不起作用。 Are we missing something here?我们在这里错过了什么吗?

Thanks in Advance.提前致谢。

This is a bug introduced in the Apache Beam 2.36.0 release following some refactoring.这是经过一些重构后在 Apache Beam 2.36.0 版本中引入的错误。 The fix is in https://github.com/apache/beam/pull/16768 and will be in the 2.37.0 release.修复在https://github.com/apache/beam/pull/16768中,将在 2.37.0 版本中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM