Hive optimizer doesn't fold the constants, however vectorized code path assumes that constants have been folded. This should be fixed in hive optimizer.
In this jira we just fix vectorization path to handle folding for negative constants. This is needed because hive plan treats negative constants as unary-minus expression on constants, therefore these expressions also need constant folding.
This fix will become redundant once constant folding is appropriately implemented in hive optimizer. (HIVE-746)