Closed arawind closed 1 month ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 48.49%. Comparing base (
4067e61
) to head (d89ef23
).
Can you explain what am I looking at in the screenshots above? I think the change in value of amount1
is expected? Can you link the docs here for me to read?
Is this change "normal" and "expected" - i.e will customers be okay with this change?
1.23 in MySQL becomes 1.230000002 in Spanner.
Thanks @manitgupta!
Can you explain what am I looking at in the screenshots above? I think the change in value of
amount1
is expected? Can you link the docs here for me to read?Is this change "normal" and "expected" - i.e will customers be okay with this change?
1.23 in MySQL becomes 1.230000002 in Spanner.
TL;DR: The issue is just in the Cloud Console UI, the actual value of 1.23 is still preserved.
The underlying reason is because we're up-casting the float
value to double
while on the Cloud Spanner API, as that's the best we can do with the limited types that the API provides.
Client libraries do the conversions float-to-double while sending, and double-to-float while receiving, and these conversions are lossless.
Now, since Cloud Console uses a JS client, and since JS does not support a float32 type, we're doing our best to convert the float64 value in the API to float32 in JS, but it is just an approximation to the actual down casting, and we end up with these values on the UI.
The actual values are preserved across migrations, import / export etc.
Design doc is available internally at go/cloud-spanner-float32.
This is a patch of https://github.com/GoogleCloudPlatform/DataflowTemplates/pull/1375.
Successfully ran the dataflow template:
MySQL source, stored to GCS via datastream:![Screenshot from 2024-07-10 01-12-34](https://github.com/GoogleCloudPlatform/DataflowTemplates/assets/1905114/5c4284e7-e703-4a00-881b-ad3388273d4f)
Spanner destination from datastream:![Screenshot from 2024-07-10 01-12-52](https://github.com/GoogleCloudPlatform/DataflowTemplates/assets/1905114/5c53a569-f45e-4445-89c4-e77887096fa3)