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/06/02 14:08:58 UTC

[GitHub] [beam] reuvenlax commented on a diff in pull request #17779: [BEAM-14529] Add integer to float64 conversion support

reuvenlax commented on code in PR #17779:
URL: https://github.com/apache/beam/pull/17779#discussion_r887995830


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/TableRowToStorageApiProto.java:
##########
@@ -348,6 +348,8 @@ static Object singularFieldToProtoValue(
           return Double.valueOf((String) value);
         } else if (value instanceof Double || value instanceof Float) {
           return ((Number) value).doubleValue();
+        } else if (value instanceof Integer || value instanceof Long) {
+          return ((Number) value).longValue();

Review Comment:
   Shouldn't this still be .doubleValue() since the proto schema for FLOAT will be a double? If so, then maybe we can simply replace
   
   else if (value instanceof Double || value instanceof Float)
   
   with
   
   else if (value instanceof Number)



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