mirror of
https://github.com/apache/impala.git
synced 2025-12-30 03:01:44 -05:00
When there are conditionals with constant values of TRUE or FALSE we can simplify them during analysis using the ExprRewriter. This patch introduces the SimplifyConditionalsRule with covers IF, OR, AND, CASE, and DECODE. It also introduces NormalizeExprsRule which normalizes AND and OR such that if either child is a BoolLiteral, then the left child is a BoolLiteral. Testing: - Added unit tests to ExprRewriteRulesTest. - Added functional tests to expr.test - Ran FE planner tests and BE expr-test. Change-Id: Id70aaf9fd99f64bd98175b7e2dbba28f350e7d3b Reviewed-on: http://gerrit.cloudera.org:8080/5585 Reviewed-by: Jim Apple <jbapple-impala@apache.org> Tested-by: Impala Public Jenkins