Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Commit

Permalink
Check codegen support for columnar BHJ with condition
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILO-HE committed Apr 19, 2022
1 parent b9c87ec commit 7f18320
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ case class ColumnarBroadcastHashJoinExec(
case BuildRight => (rkeys, lkeys)
}
}

buildCheck()

// A method in ShuffledJoin of spark3.2.
Expand All @@ -106,7 +107,15 @@ case class ColumnarBroadcastHashJoinExec(
// build check for condition
val conditionExpr: Expression = condition.orNull
if (conditionExpr != null) {
ColumnarExpressionConverter.replaceWithColumnarExpression(conditionExpr)
val columnarConditionExpr =
ColumnarExpressionConverter.replaceWithColumnarExpression(conditionExpr)
val supportCodegen =
columnarConditionExpr.asInstanceOf[ColumnarExpression].supportColumnarCodegen(null)
// Columnar BHJ with condition only has codegen version of implementation.
if (!supportCodegen) {
throw new UnsupportedOperationException(
"Condition expression is not fully supporting codegen!")
}
}
// build check types
for (attr <- streamedPlan.output) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,12 @@ class ColumnarLessThan(left: Expression, right: Expression, original: Expression
extends LessThan(left: Expression, right: Expression)
with ColumnarExpression
with Logging {

override def supportColumnarCodegen(args: java.lang.Object): Boolean = {
true && left.asInstanceOf[ColumnarExpression].supportColumnarCodegen(args) &&
right.asInstanceOf[ColumnarExpression].supportColumnarCodegen(args)
}

override def doColumnarCodeGen(args: java.lang.Object): (TreeNode, ArrowType) = {
var (left_node, left_type): (TreeNode, ArrowType) =
left.asInstanceOf[ColumnarExpression].doColumnarCodeGen(args)
Expand Down

0 comments on commit 7f18320

Please sign in to comment.