Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.15.0
-
None
Description
When filter in the query has a cast of timestamp literal, the query does not return any results.
Steps to reproduce:
1. Create a table with timestamp values with milliseconds
create table dfs.tmp.test_timestamp_filter as (select timestamp '2018-01-01 12:12:12.123' as c1, timestamp '9999-12-31 23:59:59.999' as c2);
2. Run query with filter and cast to timestamp:
select * from dfs.tmp.test_timestamp_filter where c1 = cast('2018-01-01 12:12:12.123' as timestamp(3));
This query should return a single row, but it does not return any results.
The following query returns the correct result:
select * from dfs.tmp.test_timestamp_filter where c1 = timestamp '2018-01-01 12:12:12.123';
+--------------------------+--------------------------+ | c1 | c2 | +--------------------------+--------------------------+ | 2018-01-01 12:12:12.123 | 9999-12-31 23:59:59.999 | +--------------------------+--------------------------+ 1 row selected (0.139 seconds)
The problem in DrillConstExecutor, when it used to simplify cast, timestamp precision is lost and it is trimmed to the value with 0 precision.
Attachments
Issue Links
- links to