----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/46974/#review131667 -----------------------------------------------------------
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveReduceExpressionsRule.java (line 445) <https://reviews.apache.org/r/46974/#comment195707> This logic is used for gathering constants through the tree, it is different than the logic for folding/reducing the expressions. Thus, we cannot infer a constant from BETWEEN or IN (only if IN would have a single value, but that corner case is not currently supported). ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveReduceExpressionsRule.java (line 517) <https://reviews.apache.org/r/46974/#comment195706> Same as before, this logic is used for gathering constants through the tree, thus inconsistency is not permitted (a=1 and a=2). It is different than the logic for folding/reducing the expressions, that would transform that expression into _false_. ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveUnionPullUpConstantsRule.java (line 107) <https://reviews.apache.org/r/46974/#comment195705> That is a good point. The casting is handled by the pulling up constants logic, thus we should not have any problem. I will add an extra test to the new q file in any case. - Jesús Camacho Rodríguez On May 4, 2016, 1:08 p.m., Jesús Camacho Rodríguez wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/46974/ > ----------------------------------------------------------- > > (Updated May 4, 2016, 1:08 p.m.) > > > Review request for hive and Ashutosh Chauhan. > > > Bugs: HIVE-13639 > https://issues.apache.org/jira/browse/HIVE-13639 > > > Repository: hive-git > > > Description > ------- > > HIVE-13639 > > > Diffs > ----- > > > ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveReduceExpressionsRule.java > 9006f45784359ff22075bac61f4d92a51309301c > > ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveUnionPullUpConstantsRule.java > PRE-CREATION > ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java > 8e00e0b140d7d40f25299e10be26c6eaf0231745 > ql/src/test/queries/clientpositive/cbo_union_view.q PRE-CREATION > ql/src/test/results/clientpositive/cbo_union_view.q.out PRE-CREATION > ql/src/test/results/clientpositive/union_view.q.out > badd2091e8cd74ea06dd6228603755d4a5098734 > > Diff: https://reviews.apache.org/r/46974/diff/ > > > Testing > ------- > > > Thanks, > > Jesús Camacho Rodríguez > >
