Skip to content

Commit

Permalink
[GLUTEN-5720][VL] Enable left and right semi join type in smj (#5825)
Browse files Browse the repository at this point in the history
  • Loading branch information
JkSelf authored Jun 6, 2024
1 parent 54aeb01 commit a36d121
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1246,6 +1246,16 @@ class TestOperator extends VeloxWholeStageTransformerSuite {
}
}

withSQLConf("spark.gluten.sql.columnar.forceShuffledHashJoin" -> "false") {
runQueryAndCompare(
"""
|select * from t1 left semi join t2 on t1.c1 = t2.c1 and t1.c1 > 50;
|""".stripMargin
) {
checkGlutenOperatorMatch[SortMergeJoinExecTransformer]
}
}

runQueryAndCompare(
"""
|select * from t1 cross join t2;
Expand Down
6 changes: 4 additions & 2 deletions cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,11 @@ bool SubstraitToVeloxPlanValidator::validate(const ::substrait::JoinRel& joinRel
switch (joinRel.type()) {
case ::substrait::JoinRel_JoinType_JOIN_TYPE_INNER:
case ::substrait::JoinRel_JoinType_JOIN_TYPE_LEFT:
case ::substrait::JoinRel_JoinType_JOIN_TYPE_LEFT_SEMI:
case ::substrait::JoinRel_JoinType_JOIN_TYPE_RIGHT_SEMI:
break;
default:
LOG_VALIDATION_MSG("Sort merge join only support inner and left join.");
LOG_VALIDATION_MSG("Sort merge join only support inner, left, left semi and right semi join.");
return false;
}
}
Expand All @@ -923,7 +925,7 @@ bool SubstraitToVeloxPlanValidator::validate(const ::substrait::JoinRel& joinRel
case ::substrait::JoinRel_JoinType_JOIN_TYPE_ANTI:
break;
default:
LOG_VALIDATION_MSG("Sort merge join only support inner and left join.");
LOG_VALIDATION_MSG("Join type is not supported: {}" + joinRel.type());
return false;
}

Expand Down

0 comments on commit a36d121

Please sign in to comment.