Skip to content

Commit

Permalink
extend SyntheticJoinPredicate alg apache#3
Browse files Browse the repository at this point in the history
  • Loading branch information
kasakrisz committed Dec 1, 2020
1 parent 347a694 commit 7b54c8c
Showing 1 changed file with 15 additions and 3 deletions.
Expand Up @@ -412,8 +412,6 @@ private DerivativesRetVal createDerivatives(final List<ExprNodeDesc> resultExprs
return DerivativesRetVal.EMPTY_SUCCESS;
}
CommonJoinOperator<JoinDesc> joinOp = (CommonJoinOperator) currentOp;
// storeJoinKeyEquality(equalities, joinOp, 0);
// storeJoinKeyEquality(equalities, joinOp, 1);

// 2. Backtrack expression to join output
ExprNodeDesc expr = currentNode;
Expand Down Expand Up @@ -539,8 +537,22 @@ private DerivativesRetVal createDerivatives(final List<ExprNodeDesc> resultExprs

String otherParentKeySourceName = getKeySourceName(derivativesRetVal.parentJoin, otherSideIndex);
if (tmpJoinColumnExpr.getColumn().equals(otherParentKeySourceName)) {
// TODO: check join key equality between the two joins in parent children relationship
ReduceSinkOperator otherRrsOp = (ReduceSinkOperator) joinOp.getParentOperators().get(1 - i);
String otherColumnRefJoinInput = ((ExprNodeColumnDesc)joinOp.getConf().getJoinKeys()[1 - i][0]).getColumn();
ExprNodeDesc otherRsOpInputExprNode = otherRrsOp.getColumnExprMap().get(otherParentKeySourceName);
posInRSOpKeys = -1;
for (int k = 0; k < otherRrsOp.getConf().getKeyCols().size(); k++) {
if (otherRsOpInputExprNode.isSame(otherRrsOp.getConf().getKeyCols().get(k))) {
posInRSOpKeys = k;
break;
}
}

addParentReduceSink(resultExprs, otherRrsOp, posInRSOpKeys, sourceKey);

DerivativesRetVal derivativesRetVal2 = createDerivatives(
resultExprs, joinOp.getParentOperators().get(1 - i), joinOp.getConf().getJoinKeys()[1 - i][0], sourceKey);
resultExprs, otherRrsOp, joinOp.getConf().getJoinKeys()[1 - i][0], sourceKey);
if (!derivativesRetVal2.result) {
// Something went wrong, bail out
return DerivativesRetVal.FAILURE;
Expand Down

0 comments on commit 7b54c8c

Please sign in to comment.