use of org.apache.hadoop.hive.ql.optimizer.calcite.HiveCalciteUtil.JoinPredicateInfo in project hive by apache.
the class HiveJoinToMultiJoinRule method isCombinableJoin.
/*
* Returns true if the join conditions execute over the same keys
*/
private static boolean isCombinableJoin(HiveJoin join, HiveMultiJoin leftChildJoin) throws CalciteSemanticException {
final JoinPredicateInfo joinPredInfo = HiveCalciteUtil.JoinPredicateInfo.constructJoinPredicateInfo(join, join.getCondition());
final JoinPredicateInfo leftChildJoinPredInfo = HiveCalciteUtil.JoinPredicateInfo.constructJoinPredicateInfo(leftChildJoin, leftChildJoin.getCondition());
return isCombinablePredicate(joinPredInfo, leftChildJoinPredInfo, leftChildJoin.getInputs().size());
}
use of org.apache.hadoop.hive.ql.optimizer.calcite.HiveCalciteUtil.JoinPredicateInfo in project hive by apache.
the class HiveJoin method getSortedInputs.
public ImmutableBitSet getSortedInputs() throws CalciteSemanticException {
ImmutableBitSet.Builder sortedInputsBuilder = ImmutableBitSet.builder();
JoinPredicateInfo joinPredInfo = HiveCalciteUtil.JoinPredicateInfo.constructJoinPredicateInfo(this);
List<ImmutableIntList> joinKeysInChildren = new ArrayList<ImmutableIntList>();
joinKeysInChildren.add(ImmutableIntList.copyOf(joinPredInfo.getProjsFromLeftPartOfJoinKeysInChildSchema()));
joinKeysInChildren.add(ImmutableIntList.copyOf(joinPredInfo.getProjsFromRightPartOfJoinKeysInChildSchema()));
final RelMetadataQuery mq = this.left.getCluster().getMetadataQuery();
for (int i = 0; i < this.getInputs().size(); i++) {
boolean correctOrderFound = RelCollations.contains(mq.collations(this.getInputs().get(i)), joinKeysInChildren.get(i));
if (correctOrderFound) {
sortedInputsBuilder.set(i);
}
}
return sortedInputsBuilder.build();
}
Aggregations