ayushtkn commented on a change in pull request #2815:
URL: https://github.com/apache/hive/pull/2815#discussion_r756859217
##########
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:
Can any one of this work-
```
return Stream.of(nodes1, nodes2).flatMap(Collection::stream).map(n ->
n.getType().getSqlTypeName()).distinct()
.count() == 1;
```
```
return CollectionUtils.union(nodes1, nodes2).stream().map(n ->
n.getType().getSqlTypeName()).distinct().count()
== 1;
```
```
return Stream.concat(nodes1.stream(),nodes2.stream()).map(n->
n.getType().getSqlTypeName()).distinct().count() == 1;
```
--
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]