Skip to content

Commit

Permalink
Enable NullType for First and Last in 3.0.1+ (NVIDIA#1189)
Browse files Browse the repository at this point in the history
Signed-off-by: Robert (Bobby) Evans <bobby@apache.org>
  • Loading branch information
revans2 authored Nov 23, 2020
1 parent ecc1017 commit 4f77c87
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import org.apache.spark.sql.execution.adaptive.ShuffleQueryStageExec
import org.apache.spark.sql.execution.exchange.{BroadcastExchangeLike, ShuffleExchangeLike}
import org.apache.spark.sql.execution.joins.{BroadcastHashJoinExec, ShuffledHashJoinExec, SortMergeJoinExec}
import org.apache.spark.sql.rapids.execution.{GpuBroadcastExchangeExecBase, GpuShuffleExchangeExecBase}
import org.apache.spark.sql.types.DataType
import org.apache.spark.storage.{BlockId, BlockManagerId}

class Spark301Shims extends Spark300Shims {
Expand All @@ -55,12 +56,20 @@ class Spark301Shims extends Spark300Shims {
GpuOverrides.expr[First](
"first aggregate operator",
(a, conf, p, r) => new ExprMeta[First](a, conf, p, r) {
override def isSupportedType(t: DataType): Boolean =
GpuOverrides.isSupportedType(t,
allowNull = true)

override def convertToGpu(): GpuExpression =
GpuFirst(childExprs(0).convertToGpu(), a.ignoreNulls)
}),
GpuOverrides.expr[Last](
"last aggregate operator",
(a, conf, p, r) => new ExprMeta[Last](a, conf, p, r) {
override def isSupportedType(t: DataType): Boolean =
GpuOverrides.isSupportedType(t,
allowNull = true)

override def convertToGpu(): GpuExpression =
GpuLast(childExprs(0).convertToGpu(), a.ignoreNulls)
})
Expand Down

0 comments on commit 4f77c87

Please sign in to comment.