Skip to content

Commit

Permalink
Updated attributes for pre-projection
Browse files Browse the repository at this point in the history
Signed-off-by: Firestarman <[email protected]>
  • Loading branch information
firestarman committed Jan 19, 2024
1 parent 767fbf1 commit 75728b3
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ case class GpuExpandExec(

override protected def internalDoExecuteColumnar(): RDD[ColumnarBatch] = {
val notAllLeaf = preprojectionList.exists(_.children.nonEmpty)
val (finalProjections, preprojectIter) = if (useTieredProject && notAllLeaf) {
val (boundProjections, preprojectIter) = if (useTieredProject && notAllLeaf) {
// Got some complicated expressions and tiered projection is enabled.
// Then try to do the pre-projection first.
val boundPreprojections = GpuBindReferences.bindGpuReferencesTiered(
Expand All @@ -102,13 +102,16 @@ case class GpuExpandExec(
boundPreprojections.projectAndCloseWithRetrySingleBatch(
SpillableColumnarBatch(cb, SpillPriorities.ACTIVE_ON_DECK_PRIORITY))
)
(updatedProjections, preprojectIterFunc)
val preprojectAttrs = preprojectionList.map(_.toAttribute)
val boundLists = updatedProjections.map { pl =>
GpuBindReferences.bindGpuReferencesTiered(pl, preprojectAttrs, useTieredProject)
}
(boundLists, preprojectIterFunc)
} else {
(projections, identity[Iterator[ColumnarBatch]] _)
}

val boundProjections = finalProjections.map { pl =>
GpuBindReferences.bindGpuReferencesTiered(pl, child.output, useTieredProject)
val boundLists = projections.map { pl =>
GpuBindReferences.bindGpuReferencesTiered(pl, child.output, useTieredProject)
}
(boundLists, identity[Iterator[ColumnarBatch]] _)
}

// cache in a local to avoid serializing the plan
Expand Down

0 comments on commit 75728b3

Please sign in to comment.