kgyrtkirk commented on a change in pull request #2815:
URL: https://github.com/apache/hive/pull/2815#discussion_r756292875
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HivePointLookupOptimizerRule.java
##########
@@ -655,6 +665,26 @@ private static RexNode handleAND(RexBuilder rexBuilder,
RexCall call) {
return RexUtil.composeConjunction(rexBuilder, newOperands, false);
}
+ /**
+ * Check if the type of nodes in the two collections is homogeneous within
the collections
+ * and identical between them.
+ * @param nodes1 the first collection of nodes
+ * @param nodes2 the second collection of nodes
+ * @return true if nodes in both collections is unique and identical,
false otherwise
+ */
+ private static boolean shareSameType(Collection<RexNode> nodes1,
Collection<RexNode> nodes2) {
+ Set<SqlTypeName> types1 = nodes1.stream()
Review comment:
I'm wondering if its possible to logically union `nodes1` and `nodes2`
together - that way this could become a one liner method :)
##########
File path: ql/src/test/queries/clientpositive/cbo_case_when_wrong_type.q
##########
@@ -0,0 +1,20 @@
+create external table test_case (row_seq smallint, row_desc string) stored as
parquet;
Review comment:
can we also add a simpler testcase like:
```
explain select 1 from t where a in (1,2,3) and case a when 1S then true when
2S then true end;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]