Affects Version/s: 3.1.0
Fix Version/s: None
Consider this example.
Queries: This is just about counting the number of rows, with filters always matching, and possibly sort by. 1 is always expected.
The last query (sort by and <= on timestamp) returns 0 rows.
I believe that this is the cause of other issues I have, where I have missing rows in queries with the timestamp (but not the explicit sort by).
Note that if instead of a temporary table I use a CTE for opens, the issue does not appear.
I tried workarounds (inverse order of operands, adding not or not not ) to no avail.
One thing that did work is to explicitly cast the string to a timestamp:
It might be good practice indeed, but there still is a discrepancy between how >= and <= are handled, or how sort by works.
Note: this is on Hive from [hdp3.1.4|https://docs.cloudera.com/HDPDocuments/HDP3/HDP-3.1.4/release-notes/content/patch_hive.html] , without llap.