bvolpato opened a new issue, #22401:
URL: https://github.com/apache/beam/issues/22401

   ### What happened?
   
   Hello,
   
   I am having issues when using `getFailedInserts` / `getFailedInsertsWithErr` 
from the WriteResult of a **BigQueryIO** write using methods 
`STORAGE_WRITE_API` or `STORAGE_API_AT_LEAST_ONCE`.
   
   The message leads us to think there's something wrong with the usage of the 
API, but there's no combination that can make it work:
   
   
   .getFailedInserts():
   ```
   Exception in thread "main" java.lang.IllegalArgumentException: Cannot use 
getFailedInserts as this WriteResult uses extended errors information. Use 
getFailedInsertsWithErr instead
     at 
org.apache.beam.sdk.util.Preconditions.checkArgumentNotNull(Preconditions.java:68)
     at 
org.apache.beam.sdk.io.gcp.bigquery.WriteResult.getFailedInserts(WriteResult.java:167)
   ```
   
   .getFailedInsertsWithErr():
   ```
   Exception in thread "main" java.lang.IllegalArgumentException: Cannot use 
getFailedInsertsWithErr as this WriteResult does not use extended errors. Use 
getFailedInserts instead
     at 
org.apache.beam.sdk.util.Preconditions.checkArgumentNotNull(Preconditions.java:68)
     at 
org.apache.beam.sdk.io.gcp.bigquery.WriteResult.getFailedInsertsWithErr(WriteResult.java:185)
   ```
   
   .withExtendedErrorInfo().getFailedInsertsWithErr():
   ```
   Exception in thread "main" java.lang.IllegalArgumentException: Cannot use 
getFailedInsertsWithErr as this WriteResult does not use extended errors. Use 
getFailedInserts instead
     at 
org.apache.beam.sdk.util.Preconditions.checkArgumentNotNull(Preconditions.java:68)
     at 
org.apache.beam.sdk.io.gcp.bigquery.WriteResult.getFailedInsertsWithErr(WriteResult.java:185)
   ```
   
   
   .withExtendedErrorInfo().getFailedInserts():
   ```
   Exception in thread "main" java.lang.IllegalArgumentException: Cannot use 
getFailedInserts as this WriteResult uses extended errors information. Use 
getFailedInsertsWithErr instead
     at 
org.apache.beam.sdk.util.Preconditions.checkArgumentNotNull(Preconditions.java:68)
     at 
org.apache.beam.sdk.io.gcp.bigquery.WriteResult.getFailedInserts(WriteResult.java:167)
   ```
   
   
   
   It appears that they are mutually exclusive, but upon debugging, both 
`failedInserts` and `failedInsertsWithErr` are initialized as null.
   
   
   This error started after upgrading from 2.38.0 to 2.40.0, and I couldn't 
find a workaround.
   
   I'm trying to get more details on what's causing it and will update here if 
I see anything interesting.
   
   
   ### Issue Priority
   
   Priority: 1
   
   ### Issue Component
   
   Component: io-java-gcp


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to