Skip to content

Commit

Permalink
Use UnaryLike instead of UnaryExpression (#11490)
Browse files Browse the repository at this point in the history
Signed-off-by: Alessandro Bellina <abellina@nvidia.com>
  • Loading branch information
abellina authored Sep 24, 2024
1 parent 5725e2e commit 6a9731f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ import com.nvidia.spark.rapids.shims.{AnsiUtil, GpuCastShims, GpuIntervalUtils,
import org.apache.commons.text.StringEscapeUtils

import org.apache.spark.sql.catalyst.analysis.TypeCheckResult
import org.apache.spark.sql.catalyst.expressions.{Cast, Expression, NullIntolerant, TimeZoneAwareExpression, UnaryExpression}
import org.apache.spark.sql.catalyst.expressions.{Cast, Expression, NullIntolerant, TimeZoneAwareExpression}
import org.apache.spark.sql.catalyst.trees.UnaryLike
import org.apache.spark.sql.catalyst.util.DateTimeConstants.MICROS_PER_SECOND
import org.apache.spark.sql.catalyst.util.DateTimeUtils
import org.apache.spark.sql.internal.SQLConf
Expand All @@ -40,7 +41,8 @@ import org.apache.spark.sql.rapids.shims.RapidsErrorUtils
import org.apache.spark.sql.types._

/** Meta-data for cast and ansi_cast. */
final class CastExprMeta[INPUT <: UnaryExpression with TimeZoneAwareExpression with NullIntolerant](
final class CastExprMeta[
INPUT <: UnaryLike[Expression] with TimeZoneAwareExpression with NullIntolerant](
cast: INPUT,
val evalMode: GpuEvalMode.Value,
conf: RapidsConf,
Expand Down Expand Up @@ -76,7 +78,7 @@ final class CastExprMeta[INPUT <: UnaryExpression with TimeZoneAwareExpression w
}

/** Meta-data for cast, ansi_cast and ToPrettyString */
abstract class CastExprMetaBase[INPUT <: UnaryExpression with TimeZoneAwareExpression](
abstract class CastExprMetaBase[INPUT <: UnaryLike[Expression] with TimeZoneAwareExpression](
cast: INPUT,
conf: RapidsConf,
parent: Option[RapidsMeta[_, _, _]],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import com.nvidia.spark.rapids.shims.{DistributionUtil, SparkShimImpl}
import org.apache.spark.sql.catalyst.expressions.{Attribute, AttributeReference, BinaryExpression, Cast, ComplexTypeMergingExpression, Expression, QuaternaryExpression, RuntimeReplaceable, String2TrimExpression, TernaryExpression, TimeZoneAwareExpression, UnaryExpression, UTCTimestamp, WindowExpression, WindowFunction}
import org.apache.spark.sql.catalyst.expressions.aggregate.{AggregateExpression, AggregateFunction, ImperativeAggregate, TypedImperativeAggregate}
import org.apache.spark.sql.catalyst.plans.physical.Partitioning
import org.apache.spark.sql.catalyst.trees.TreeNodeTag
import org.apache.spark.sql.catalyst.trees.{TreeNodeTag, UnaryLike}
import org.apache.spark.sql.connector.read.Scan
import org.apache.spark.sql.execution.SparkPlan
import org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanExec
Expand Down Expand Up @@ -1347,7 +1347,7 @@ abstract class RuntimeReplaceableUnaryAstExprMeta[INPUT <: RuntimeReplaceable](
/**
* Base class for metadata around `UnaryExpression`.
*/
abstract class UnaryExprMeta[INPUT <: UnaryExpression](
abstract class UnaryExprMeta[INPUT <: Expression with UnaryLike[Expression]](
expr: INPUT,
conf: RapidsConf,
parent: Option[RapidsMeta[_, _, _]],
Expand Down

0 comments on commit 6a9731f

Please sign in to comment.