matrixone icon indicating copy to clipboard operation
matrixone copied to clipboard

[Discussion]: What's the semantic of cast BIGINT as TIMESTAMP

Open m-schen opened this issue 2 years ago • 2 comments

Is there an existing issue for the same bug?

  • [X] I have checked the existing issues.

Environment

I have add the convert rule
 int64 >= timestamp ==> timestamp >= timestamp

But the semantic of int64 ==> timestamp is confused.
Some BVT result is different with MySQL.

e.g.
 select * from t1 where a>20220102;
the type of a is timestamp

Actual Behavior

a 2020-01-01 00:00:00 2022-01-02 00:00:00 2022-01-02 00:00:01 2022-01-02 00:00:02

Expected Behavior

a 2022-01-02 00:00:01 2022-01-02 00:00:02

Steps to Reproduce

No response

Additional information

No response

m-schen avatar Jul 04 '22 14:07 m-schen

and the case

select a-1 from t;

if a is timestamp, and we convert 1 into timestamp, we should support '-' operator between timestamp.

m-schen avatar Jul 04 '22 14:07 m-schen

do we need calculate operator (+, -, / and so on) between timestamp?

m-schen avatar Jul 04 '22 14:07 m-schen

it's just a discussion.

m-schen avatar Oct 20 '22 08:10 m-schen

@m-schen any status update?

sukki37 avatar Oct 29 '22 03:10 sukki37

I recall that CAST bigint AS timestamp has the same result as from_unixtime. However it's not discussed.

aunjgr avatar Oct 29 '22 16:10 aunjgr

Hello @m-schen. The bug issue in the BVT test code has not been removed,issues automatically open.

matrix-meow avatar Nov 16 '22 03:11 matrix-meow

Hello @m-schen. The bug issue in the BVT test code has not been removed,issues automatically open.

matrix-meow avatar Dec 16 '22 15:12 matrix-meow

after pr, it can be closed.

m-schen avatar Dec 19 '22 15:12 m-schen