Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid result of TIME to TIMESTAMP cast for high precisions #5736

Closed
findepi opened this issue Oct 29, 2020 · 1 comment · Fixed by #5742
Closed

Invalid result of TIME to TIMESTAMP cast for high precisions #5736

findepi opened this issue Oct 29, 2020 · 1 comment · Fixed by #5742
Assignees
Labels
bug Something isn't working correctness
Milestone

Comments

@findepi
Copy link
Member

findepi commented Oct 29, 2020

The value renders correctly (appears to be correct):

presto> SELECT CAST(TIME '12:34:56.55555555' AS TIMESTAMP(7));
            _col0
-----------------------------
 2020-10-29 12:34:56.5555556
(1 row)

but actual runtime value is not correct:

presto> SELECT CAST(TIME '12:34:56.55555555' AS TIMESTAMP(7)) = TIMESTAMP '2020-10-29 12:34:56.5555556';
 _col0
-------
 false
(1 row)
@findepi findepi added bug Something isn't working correctness labels Oct 29, 2020
@findepi
Copy link
Member Author

findepi commented Oct 29, 2020

The example is taken from existing test:

assertThat(assertions.expression("CAST(TIME '12:34:56.55555555' AS TIMESTAMP(7))")).matches("TIMESTAMP '2020-05-01 12:34:56.5555556'");

this reveals a generic deficiency in our testing methodology.

cc @martint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctness
2 participants