apilloud commented on code in PR #24366:
URL: https://github.com/apache/beam/pull/24366#discussion_r1033924832


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/TableRowToStorageApiProto.java:
##########
@@ -408,9 +409,25 @@ private static void fieldDescriptorFromTableField(
       case "INT64":
       case "INTEGER":
         if (value instanceof String) {
-          return Long.valueOf((String) value);
+          try {
+            return Long.valueOf((String) value);
+          } catch (NumberFormatException e) {
+            // Expected. Element will be added to the failed element 
PCollection

Review Comment:
   These are going to result in a generic 
`SchemaDoesntMatchException("Unexpected value :"...)` being thrown which will 
make this potentially difficult to debug when it happens. If we can't just let 
the exception bubble up here, you should wrap it with a new exception rather 
than just dropping it. (Same thing for the exceptions below.)



-- 
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