private static boolean shareSameType(
            Collection<SimilarRexNodeElement> nodes1, Collection<SimilarRexNodeElement> nodes2) {
      return Stream.of(nodes1, nodes2).flatMap(Collection::stream)
          .map(n -> n.getRexNode().getType().getSqlTypeName())
          .distinct()
          .count() == 1;
    }
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
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HivePointLookupOptimizerRule.java