bastewart commented on issue #25228:
URL: https://github.com/apache/beam/issues/25228#issuecomment-1443618673

   Yeah, I have experimented and the [Streaming 
API](https://cloud.google.com/bigquery/docs/reference/rest/v2/tabledata/insertAll)
 is much more lenient.
   
   In general there can be extraneous (and "missing") decimal portions for all 
the numeric types. These are all accepted in the Streaming API for all of 
`INTEGER` (`INT64`), `NUMERIC`, `BIGNUMERIC` and `FLOAT` (`FLOAT64`):
    - `"1.0"`
    - `1.0`
    - `"1"`
    - `1`
    
   Any non-zero decimal portion is not valid for an `INTEGER` though. So these 
are valid only for everything else:
    - `"1.1"`
    - `1.1`
   
   This does mean that in addition to [my fix for double/float -> 
long](https://github.com/bastewart/beam/commit/38601213f81896444c60dd9e590f8a795358d09a)
 the current handling of `String` when an `INT64` is desired will fail for 
something like `"1.0"`, where the Streaming API would accept it: 
https://github.com/apache/beam/blob/dcfadddf52ae68a8d3d605e3a072c5d611b1fe14/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/TableRowToStorageApiProto.java#L693-L695


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