Skip to content

Add mapping somewhere so we can better handle INT64 and FLOAT64 types. #16

Description

@bgood

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Priority 1enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions