Skip to content

Commit

Permalink
HIVE-8781: Nullsafe joins are busted on Tez (Gunther Hagleitner, revi…
Browse files Browse the repository at this point in the history
…ewed by Prasanth J)

git-svn-id: https://svn.apache.org/repos/asf/hive/trunk@1637489 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
hagleitn committed Nov 8, 2014
1 parent 0872cec commit cda4fc8
Show file tree
Hide file tree
Showing 5 changed files with 1,651 additions and 2 deletions.
1 change: 1 addition & 0 deletions itests/src/test/resources/testconfiguration.properties
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ minitez.query.files.shared=alter_merge_2_orc.q,\
insert_update_delete.q,\
join0.q,\
join1.q,\
join_nullsafe.q,\
leftsemijoin.q,\
limit_pushdown.q,\
load_dyn_part1.q,\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,11 @@ private int compareKeys(List<Object> k1, List<Object> k2) {
WritableComparable key_1 = (WritableComparable) k1.get(i);
WritableComparable key_2 = (WritableComparable) k2.get(i);
if (key_1 == null && key_2 == null) {
return nullsafes != null && nullsafes[i] ? 0 : -1; // just return k1 is
// smaller than k2
if (nullsafes != null && nullsafes[i]) {
continue;
} else {
return -1;
}
} else if (key_1 == null) {
return -1;
} else if (key_2 == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ private void convertJoinSMBJoin(JoinOperator joinOp, OptimizeTezProcContext cont
new MapJoinDesc(null, null, joinDesc.getExprs(), null, null,
joinDesc.getOutputColumnNames(), mapJoinConversionPos, joinDesc.getConds(),
joinDesc.getFilters(), joinDesc.getNoOuterJoin(), null);
mapJoinDesc.setNullSafes(joinDesc.getNullSafes());
mapJoinDesc.setFilterMap(joinDesc.getFilterMap());
mapJoinDesc.resetOrder();
}

@SuppressWarnings("unchecked")
Expand Down
Loading

0 comments on commit cda4fc8

Please sign in to comment.