Skip to content

Commit

Permalink
refine
Browse files Browse the repository at this point in the history
Signed-off-by: sperlingxx <lovedreamf@gmail.com>
  • Loading branch information
sperlingxx committed Aug 27, 2021
1 parent 07ba094 commit 3766c0e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import com.nvidia.spark.rapids._
import com.nvidia.spark.rapids.spark311cdh.RapidsShuffleManager

import org.apache.spark.sql.catalyst.catalog.{CatalogTable, SessionCatalog}
import org.apache.spark.sql.catalyst.expressions.NamedExpression
import org.apache.spark.sql.execution._
import org.apache.spark.sql.execution.columnar.InMemoryTableScanExec
import org.apache.spark.sql.internal.{SQLConf, StaticSQLConf}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ package org.apache.spark.sql.rapids.shims.spark313

import com.nvidia.spark.rapids.GpuColumnarToRowExecParent

import org.apache.spark.sql.catalyst.expressions.NamedExpression
import org.apache.spark.sql.execution.{ColumnarToRowTransition, SparkPlan}

case class GpuColumnarToRowTransitionExec(child: SparkPlan,
override val exportColumnarRdd: Boolean = false)
extends GpuColumnarToRowExecParent(child, exportColumnarRdd) with ColumnarToRowTransition
override val exportColumnarRdd: Boolean = false,
override val postProjection: Seq[NamedExpression] = Seq.empty)
extends GpuColumnarToRowExecParent(child, exportColumnarRdd, postProjection)
with ColumnarToRowTransition
19 changes: 13 additions & 6 deletions sql-plugin/src/main/scala/com/nvidia/spark/rapids/RapidsMeta.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1123,19 +1123,26 @@ abstract class TypedImperativeAggExprMeta[INPUT <: TypedImperativeAggregate[_]](
def aggBufferAttribute: AttributeReference

/**
* Returns a buffer converter who can generate a Expression to transform the aggregation
* buffer of wrapped function from CPU format to GPU format.
* Returns a buffer converter who can generate a Expression to transform the aggregation buffer
* of wrapped function from CPU format to GPU format. The conversion occurs on the CPU, so the
* generated expression should be a CPU Expression executed by row.
*/
def createCpuToGpuBufferConverter(): CpuToGpuAggregateBufferConverter =
throw new NotImplementedError("")
throw new NotImplementedError("The method should be implemented by specific functions")

/**
* Returns a buffer converter who can generate a Expression to transform the aggregation
* buffer of wrapped function from GPU format to CPU format.
* Returns a buffer converter who can generate a Expression to transform the aggregation buffer
* of wrapped function from GPU format to CPU format. The conversion occurs on the CPU, so the
* generated expression should be a CPU Expression executed by row.
*/
def createGpuToCpuBufferConverter(): GpuToCpuAggregateBufferConverter =
throw new NotImplementedError("")
throw new NotImplementedError("The method should be implemented by specific functions")

/**
* Whether buffers of current Aggregate is able to be converted from CPU to GPU format and
* reversely in runtime. If true, it assumes both createCpuToGpuBufferConverter and
* createGpuToCpuBufferConverter are implemented.
*/
val supportBufferConversion: Boolean = false
}

Expand Down

0 comments on commit 3766c0e

Please sign in to comment.