Skip to content

Precision of TIMESTAMP type is different #73

Description

@naoina

On cloud-spanner-emulator, the following SQL will get the error spanner: code = "OutOfRange", desc = "Invalid timestamp: '2022-03-31T23:59:59.999999999Z'"

SELECT TIMESTAMP('2022-03-31T23:59:59.999999999Z');

However, Cloud Spanner does not return any error.

Also the emulator accept nanoseconds level value as TIMESTAMP type, but MAX() and MIN() returns microseconds's one.
For example, if SomethingTable has CreatedAt TIMESTAMP NOT NULL column and value of 2022-03-31T14:59:59.999999999Z was inserted.
The following SQL returns 2022-03-31T14:59:59.999999999Z.

SELECT CreatedAt FROM SomethingTable

However, the following SQL returns 2022-03-31T14:59:59.999999Z.

SELECT MAX(CreatedAt) FROM SomethingTable;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions