Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag GpuWindow child expressions for GPU execution #6057

Merged
merged 6 commits into from
Jul 26, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -374,19 +374,26 @@ abstract class UnixTimeExprMeta[A <: BinaryExpression with TimeZoneAwareExpressi
rule: DataFromReplacementRule)
extends BinaryExprMeta[A](expr, conf, parent, rule) {

var sparkFormat: String = _
var strfFormat: String = _
val optionalRightStringLit: Option[String] =
mythrocks marked this conversation as resolved.
Show resolved Hide resolved
if (expr.right.dataType == StringType) {
extractStringLit(expr.right)
} else {
None
}

lazy val (sparkFormat, strfFormat): (String, String) =
optionalRightStringLit match {
case Some(rightLit) =>
(rightLit,
DateUtils.tagAndGetCudfFormat(this, rightLit,
expr.left.dataType == DataTypes.StringType))
case None => (null, null)
}

override def tagExprForGpu(): Unit = {
// Date and Timestamp work too
if (expr.right.dataType == StringType) {
extractStringLit(expr.right) match {
case Some(rightLit) =>
sparkFormat = rightLit
strfFormat = DateUtils.tagAndGetCudfFormat(this,
sparkFormat, expr.left.dataType == DataTypes.StringType)
case None =>
willNotWorkOnGpu("format has to be a string literal")
}
if (expr.right.dataType == StringType && optionalRightStringLit.isEmpty) {
willNotWorkOnGpu("format has to be a string literal")
}
}
}
Expand Down