Skip to content

timestamp comparison with timestamptz is not supported #5454

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

Closed
comphead opened this issue Mar 2, 2023 · 2 comments · Fixed by #5869
Closed

timestamp comparison with timestamptz is not supported #5454

comphead opened this issue Mar 2, 2023 · 2 comments · Fixed by #5869
Labels
bug Something isn't working

Comments

@comphead
Copy link
Contributor

comphead commented Mar 2, 2023

Describe the bug
Datafusion doesn't support comparison between Timestamp and TimestampTz

To Reproduce

DataFusion CLI v18.0.0
❯ select '2021-1-1'::timestamptz > '2021-1-1'::timestamp
;
Internal error: Cannot evaluate binary expression Gt with types Timestamp(Nanosecond, None) and Timestamp(Nanosecond, Some("+00:00")). This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker

the same query in PG runs fine
Expected behavior
Make timestamp comparison with timestamptz work

Additional context
None

@comphead comphead added the bug Something isn't working label Mar 2, 2023
@comphead
Copy link
Contributor Author

comphead commented Mar 3, 2023

Related to #5164

The rootcause likely in arrow-rs cast


[datafusion/physical-expr/src/expressions/cast.rs:168] &scalar = Utf8("2000-01-01T00:00:00")
[datafusion/physical-expr/src/expressions/cast.rs:169] &cast_type = Timestamp(
    Nanosecond,
    Some(
        "+00:00",
    ),
)
[datafusion/physical-expr/src/expressions/cast.rs:170] &cast_scalar = TimestampNanosecond(946684800000000000, None)

So timestamptz was requested but got timestamp

@comphead
Copy link
Contributor Author

comphead commented Mar 6, 2023

Filed apache/arrow-rs#3800
Waiting for new arrow-rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant