Would it be possible to somehow add a mapping somewhere, or other configuration option, to indicate whether the adapter should use INT64 or FLOAT64 here? The reason is that this prevents the usage of an INT64 column to be used as part of the primary key of a table, while that is a very common data type to use in the primary key.
Using FLOAT64 as part of a primary key is possible, but I would recommend against it if the actual number is (supposed to be) an integer, as there could be subtle rounding problems.
Consider for example the following statement:
SELECT CAST(9007199254740993 as FLOAT64);
This will not return 9007199254740993 but 9007199254740992 when you execute it in Cloud Spanner. (Note: This is not specific to Cloud Spanner, but a general limitation of floating point numbers.)
Another possibility could be to map numeric values in DynamoDB to the NUMERIC data type in Cloud Spanner.
Originally posted by @olavloite in #3 (comment)
Would it be possible to somehow add a mapping somewhere, or other configuration option, to indicate whether the adapter should use
INT64orFLOAT64here? The reason is that this prevents the usage of anINT64column to be used as part of the primary key of a table, while that is a very common data type to use in the primary key.Using
FLOAT64as part of a primary key is possible, but I would recommend against it if the actual number is (supposed to be) an integer, as there could be subtle rounding problems.Consider for example the following statement:
This will not return 9007199254740993 but 9007199254740992 when you execute it in Cloud Spanner. (Note: This is not specific to Cloud Spanner, but a general limitation of floating point numbers.)
Another possibility could be to map numeric values in DynamoDB to the
NUMERICdata type in Cloud Spanner.Originally posted by @olavloite in #3 (comment)