mirror of
https://github.com/apache/impala.git
synced 2026-01-22 18:02:34 -05:00
For 'case' function, if left WHEN condition is true, SimplifyConditionalsRule will cast the THEN result-expression to original expression's type before return result. In this Jira, we would like to remove the cast function for two reasons: 1. SimplifyConditionalsRule only applys to analyzed expression, which means expression has already been casted to compatible type before it reaches the expression rewrite step. 2. The cast function will cause IllegalStateException when 'CASE WHEN TRUE' appearing in the where conjunction. For example: Query: select * from functional.alltypessmall where case when true then id < 50 END ERROR: IllegalStateException: null Testing: - Added e2e test to exprs.test - Added unit test to ExprRewriteRulesTest - Added unit test to ExprRewriterTest Change-Id: I640d577200e76121c72685e4aaba1ef312a2d8b4 Reviewed-on: http://gerrit.cloudera.org:8080/14540 Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
75 KiB
75 KiB