> I'm wondering why Hive tries to scan all partitions when the quotes are > omitted. Without the quotes, shouldn't 2016-11-28-00 get evaluated as an > arithmetic expression, then get cast to a string, and then partitioning > pruning still occur?
The order of evaluation is different - String = Integer becomes UDFToDouble(String) = UDFToDouble(Integer) (because that keeps the >= behavior consistent with =). The version you're running is very relevant here. Not all versions of hive have a constant folding optimization & even with that, only recent versions of hive perform partition pruning when the partition column is wrapped in a UDF. Posting the output of an "explain <query>" would also help. Cheers, Gopal