I ran a select query with predicate on a non primary key column. If I specify the higher value first, and then the lower value, select returns zero rows. Not sure if this is a bug or it is working as expected.
Query: select count(ss_item_sk) from store_sales_1p where ss_sold_date_sk between 2450817 and 2450816
+-------------------+
| count(ss_item_sk) |
+-------------------+
| 0 |
+-------------------+
Fetched 1 row(s) in 1.58s
Query: select count(ss_item_sk) from store_sales_1p where ss_sold_date_sk between 2450816 and 2450817
+-------------------+
| count(ss_item_sk) |
+-------------------+
| 17212 |
+-------------------+
Fetched 1 row(s) in 1.52s
This happens because of the way predicates are pushdown. between x and y, is convereted to >x and <y irrespective of x & y.
Regards,
Bhaskar