sql - Why cast as timestamp give out two different result -
i have hive table 2 rows this:
0: jdbc:hive2://localhost:10000/default> select * t2; +-----+--------+ | id | value | +-----+--------+ | 10 | 100 | | 11 | 101 | +-----+--------+ 2 rows selected (1.116 seconds)
but when issue query :
select cast(1 timestamp) t2;
it gives out unconsistent result, can tell me reason ?
0: jdbc:hive2://localhost:10000/default> select cast(1 timestamp) t2; +--------------------------+ | _c0 | +--------------------------+ | 1970-01-01 07:00:00.001 | | 1970-01-01 07:00:00.001 | +--------------------------+ 2 rows selected (0.913 seconds) 0: jdbc:hive2://localhost:10000/default> select cast(1 timestamp) t2; +--------------------------+ | _c0 | +--------------------------+ | 1970-01-01 08:00:00.001 | | 1970-01-01 07:00:00.001 | +--------------------------+ 2 rows selected (1.637 seconds)
i can't reproduce problem, hive version using? hive had bug timestamp , bigint (see https://issues.apache.org/jira/browse/hive-3454), doesn't explain problem. example hive 0.14 gives different results for
select (cast 1 timestamp), cast(cast(1 double) timestamp) my_table limit 5;
Comments
Post a Comment