Skip to content

Does Datafusion support type coercion between Arrow Timestamp and unix timestamp in query? #12829

Closed Answered by jonahgao
niebayes asked this question in Q&A
Discussion options

You must be logged in to vote

I believe it can't, but you can use the from_unixtime function.

> create table t(a timestamp);
0 row(s) fetched.
Elapsed 0.013 seconds.

> select * from t where a > 1725186000;
type_coercion
caused by
Error during planning: Cannot infer common argument type for comparison operation Timestamp(Nanosecond, None) > Int64

> select * from t where a > from_unixtime(1725186000);
+---+
| a |
+---+
+---+
0 row(s) fetched.
Elapsed 0.007 seconds.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@niebayes
Comment options

Answer selected by niebayes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants