Skip to content

Commit

Permalink
Fix bug of stale value in joinedRow
Browse files Browse the repository at this point in the history
  • Loading branch information
chenghao-intel committed Jul 31, 2014
1 parent 55baef7 commit 72b1394
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ trait BinaryRepeatableIteratorNode extends BinaryNode {
(if (!key.anyNull) rightIter else BinaryJoinNode.EMPTY_NULL_LIST).collect {
case r if (boundCondition(joinedRow.withRight(r))) => {
matched = true
joinedRow
joinedRow.copy
}
} ++ BinaryJoinNode.SINGLE_NULL_LIST.collect {
case dummy if (!matched) => {
joinedRow.withRight(rightNullRow)
joinedRow.withRight(rightNullRow).copy
}
}
}
Expand All @@ -107,11 +107,11 @@ trait BinaryRepeatableIteratorNode extends BinaryNode {
(if (!key.anyNull) leftIter else BinaryJoinNode.EMPTY_NULL_LIST).collect {
case l if (boundCondition(joinedRow.withLeft(l))) => {
matched = true
joinedRow
joinedRow.copy
}
} ++ BinaryJoinNode.SINGLE_NULL_LIST.collect {
case dummy if (!matched) => {
joinedRow.withLeft(leftNullRow)
joinedRow.withLeft(leftNullRow).copy
}
}
}
Expand All @@ -128,23 +128,23 @@ trait BinaryRepeatableIteratorNode extends BinaryNode {
case (r, idx) if (boundCondition(joinedRow.withRight(r)))=> {
matched = true
rightMatchedSet.add(idx)
joinedRow
joinedRow.copy
}
} ++ BinaryJoinNode.SINGLE_NULL_LIST.collect {
case dummy if (!matched) => {
joinedRow.withRight(rightNullRow)
joinedRow.withRight(rightNullRow).copy
}
}
} ++ rightIter.zipWithIndex.collect {
case (r, idx) if (!rightMatchedSet.contains(idx)) => {
joinedRow(leftNullRow, r)
joinedRow(leftNullRow, r).copy
}
}
} else {
leftIter.iterator.map[Row] { l =>
joinedRow(l, rightNullRow)
joinedRow(l, rightNullRow).copy
} ++ rightIter.iterator.map[Row] { r =>
joinedRow(leftNullRow, r)
joinedRow(leftNullRow, r).copy
}
}
}
Expand Down

0 comments on commit 72b1394

Please sign in to comment.