You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/11/29 04:09:39 UTC

[GitHub] [beam] slilichenko commented on a diff in pull request #24366: Improve Integer conversion in BigQueryIO's Storage Write API method.

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


##########
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:
   Addressed in the latest commit. Only implemented for the INTEGER type at the moment. 



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org