-
Notifications
You must be signed in to change notification settings - Fork 232
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
Remove GpuAttributeReference and GpuSortOrder #253
Changes from all commits
3ad53c1
18d7496
60baaff
8db31c0
82163b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ object GpuExpressionsUtils { | |
resultCvs | ||
} | ||
|
||
def getTrimString(trimStr: Option[GpuExpression]): String = trimStr match { | ||
def getTrimString(trimStr: Option[Expression]): String = trimStr match { | ||
case Some(GpuLiteral(data, StringType)) => | ||
if (data == null) { | ||
null | ||
|
@@ -79,7 +79,7 @@ trait GpuExpression extends Expression with Unevaluable with Arm { | |
* we have to jump through some hoops to make this work. | ||
*/ | ||
def disableCoalesceUntilInput(): Boolean = | ||
children.exists{ | ||
children.exists { | ||
case c: GpuExpression => c.disableCoalesceUntilInput() | ||
case _ => false // This path should never really happen | ||
} | ||
|
@@ -118,7 +118,7 @@ abstract class GpuUnaryExpression extends UnaryExpression with GpuExpression { | |
def outputTypeOverride: DType = null | ||
|
||
override def columnarEval(batch: ColumnarBatch): Any = { | ||
val input = child.asInstanceOf[GpuExpression].columnarEval(batch) | ||
val input = child.columnarEval(batch) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please clarify. From what I understand so far children could possibly contain a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nothing that is evaluated can contain a |
||
try { | ||
input match { | ||
case vec: GpuColumnVector => | ||
|
@@ -165,8 +165,8 @@ trait GpuBinaryExpression extends BinaryExpression with GpuExpression { | |
var lhs: Any = null | ||
var rhs: Any = null | ||
try { | ||
lhs = left.asInstanceOf[GpuExpression].columnarEval(batch) | ||
rhs = right.asInstanceOf[GpuExpression].columnarEval(batch) | ||
lhs = left.columnarEval(batch) | ||
rhs = right.columnarEval(batch) | ||
|
||
(lhs, rhs) match { | ||
case (l: GpuColumnVector, r: GpuColumnVector) => doColumnar(l, r) | ||
|
@@ -237,11 +237,11 @@ abstract class CudfBinaryOperator extends GpuBinaryOperator with CudfBinaryExpre | |
|
||
trait GpuString2TrimExpression extends String2TrimExpression with GpuExpression { | ||
|
||
override def srcStr: GpuExpression | ||
override def srcStr: Expression | ||
|
||
override def trimStr: Option[GpuExpression] | ||
override def trimStr: Option[Expression] | ||
|
||
override def children: Seq[GpuExpression] = srcStr +: trimStr.toSeq | ||
override def children: Seq[Expression] = srcStr +: trimStr.toSeq | ||
|
||
def strippedColumnVector(value: GpuColumnVector, sclarValue: Scalar): GpuColumnVector | ||
|
||
|
@@ -294,9 +294,9 @@ trait GpuTernaryExpression extends TernaryExpression with GpuExpression { | |
var val1: Any = null | ||
var val2: Any = null | ||
try { | ||
val0 = children(0).asInstanceOf[GpuExpression].columnarEval(batch) | ||
val1 = children(1).asInstanceOf[GpuExpression].columnarEval(batch) | ||
val2 = children(2).asInstanceOf[GpuExpression].columnarEval(batch) | ||
val0 = children(0).columnarEval(batch) | ||
val1 = children(1).columnarEval(batch) | ||
val2 = children(2).columnarEval(batch) | ||
|
||
(val0, val1, val2) match { | ||
case (v0: GpuColumnVector, v1: GpuColumnVector, v2: GpuColumnVector) => | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the time we come here we will only have 2 types in the expression i.e.
AttributeReference
,SortOrder
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transform walks through the tree and if the supplied pattern matches something in the tree it will be replaced with what is returned. So the goal of the code is to replace all
AttributeReference
instances withGpuBoundReference
instances. Everything else passes through.