Skip to content

Commit

Permalink
Keep post-filter coalesce for hash joins
Browse files Browse the repository at this point in the history
  • Loading branch information
jlowe committed Oct 5, 2021
1 parent fcfb436 commit cb20aee
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ class GpuBroadcastHashJoinMeta(
left, right)
// The GPU does not yet support conditional joins, so conditions are implemented
// as a filter after the join when possible.
condition.map {
c => GpuFilterExec(c.convertToGpu(), joinExec, coalesceAfter = false)
}.getOrElse(joinExec)
condition.map(c => GpuFilterExec(c.convertToGpu(), joinExec)).getOrElse(joinExec)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ class GpuShuffledHashJoinMeta(
join.rightKeys)
// The GPU does not yet support conditional joins, so conditions are implemented
// as a filter after the join when possible.
condition.map {
c => GpuFilterExec(c.convertToGpu(), joinExec, coalesceAfter = false)
}.getOrElse(joinExec)
condition.map(c => GpuFilterExec(c.convertToGpu(), joinExec)).getOrElse(joinExec)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ class GpuSortMergeJoinMeta(
join.rightKeys)
// The GPU does not yet support conditional joins, so conditions are implemented
// as a filter after the join when possible.
condition.map {
c => GpuFilterExec(c.convertToGpu(), joinExec, coalesceAfter = false)
}.getOrElse(joinExec)
condition.map(c => GpuFilterExec(c.convertToGpu(), joinExec)).getOrElse(joinExec)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ class GpuBroadcastHashJoinMeta(
left, right)
// The GPU does not yet support conditional joins, so conditions are implemented
// as a filter after the join when possible.
condition.map { c =>
GpuFilterExec(c.convertToGpu(), joinExec, coalesceAfter = false)
}.getOrElse(joinExec)
condition.map(c => GpuFilterExec(c.convertToGpu(), joinExec)).getOrElse(joinExec)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ class GpuShuffledHashJoinMeta(
join.rightKeys)
// The GPU does not yet support conditional joins, so conditions are implemented
// as a filter after the join when possible.
condition.map {
c => GpuFilterExec(c.convertToGpu(), joinExec, coalesceAfter = false)
}.getOrElse(joinExec)
condition.map(c => GpuFilterExec(c.convertToGpu(), joinExec)).getOrElse(joinExec)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ class GpuSortMergeJoinMeta(
join.rightKeys)
// The GPU does not yet support conditional joins, so conditions are implemented
// as a filter after the join when possible.
condition.map {
c => GpuFilterExec(c.convertToGpu(), joinExec, coalesceAfter = false)
}.getOrElse(joinExec)
condition.map(c => GpuFilterExec(c.convertToGpu(), joinExec)).getOrElse(joinExec)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ class GpuShuffledHashJoinMeta(
join.rightKeys)
// The GPU does not yet support conditional joins, so conditions are implemented
// as a filter after the join when possible.
condition.map {
c => GpuFilterExec(c.convertToGpu(), joinExec, coalesceAfter = false)
}.getOrElse(joinExec)
condition.map(c => GpuFilterExec(c.convertToGpu(), joinExec)).getOrElse(joinExec)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ class GpuSortMergeJoinMeta(
join.rightKeys)
// The GPU does not yet support conditional joins, so conditions are implemented
// as a filter after the join when possible.
condition.map {
c => GpuFilterExec(c.convertToGpu(), joinExec, coalesceAfter = false)
}.getOrElse(joinExec)
condition.map(c => GpuFilterExec(c.convertToGpu(), joinExec)).getOrElse(joinExec)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ class GpuBroadcastHashJoinMeta(
left, right)
// The GPU does not yet support conditional joins, so conditions are implemented
// as a filter after the join when possible.
condition.map {
c => GpuFilterExec(c.convertToGpu(), joinExec, coalesceAfter = false)
}.getOrElse(joinExec)
condition.map(c => GpuFilterExec(c.convertToGpu(), joinExec)).getOrElse(joinExec)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ class GpuBroadcastHashJoinMeta(
left, right)
// The GPU does not yet support conditional joins, so conditions are implemented
// as a filter after the join when possible.
condition.map {
c => GpuFilterExec(c.convertToGpu(), joinExec, coalesceAfter = false)
}.getOrElse(joinExec)
condition.map(c => GpuFilterExec(c.convertToGpu(), joinExec)).getOrElse(joinExec)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ class GpuBroadcastNestedLoopJoinMeta(
} else {
// condition cannot be implemented via AST so fallback to a post-filter if necessary
condition.map {
// TODO: Restore batch coalescing logic here.
// Avoid requesting a post-filter-coalesce here, as we've seen poor performance with
// the cross join microbenchmark. This is a short-term hack for the benchmark, and
// ultimately this should be solved with the resolution of one or more of the following:
// https://github.com/NVIDIA/spark-rapids/issues/3749
// https://github.com/NVIDIA/spark-rapids/issues/3750
c => GpuFilterExec(c, joinExec, coalesceAfter = false)
}.getOrElse(joinExec)
}
Expand Down

0 comments on commit cb20aee

Please sign in to comment.