Skip to content
Closed
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
Prev Previous commit
Next Next commit
use better method name
  • Loading branch information
kiszk committed Jul 27, 2018
commit 0d24fa95edf3cf8ec18a7bca34382e8aff24e505
Original file line number Diff line number Diff line change
Expand Up @@ -4055,7 +4055,7 @@ case class ArrayExcept(left: Expression, right: Expression) extends ArraySetLike
pos
}

val exceptEquals: (ArrayData, ArrayData) => ArrayData = {
val evalExcept: (ArrayData, ArrayData) => ArrayData = {
(array1: ArrayData, array2: ArrayData) =>
if (elementTypeSupportEquals) {
elementType match {
Expand Down Expand Up @@ -4176,7 +4176,7 @@ case class ArrayExcept(left: Expression, right: Expression) extends ArraySetLike
val array1 = input1.asInstanceOf[ArrayData]
val array2 = input2.asInstanceOf[ArrayData]

exceptEquals(array1, array2)
evalExcept(array1, array2)
}

override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
Copy link
Contributor

@cloud-fan cloud-fan Jul 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think codegen can provide much value, given the complexity of this function. We do codegen mostly for supporting whole-stage-codegen. How about

val expr = ctx.addReference("arrayExceptExpr", this)
nullSafeCodeGen(ctx, ev, (array1, array2) => {
  s"$expr.nullSafeEval($array1, $array2)"
} 
"""

cc @rednaxelafx @rxin

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seem to make sense. Codegen can only increase the number of supporting types (i.e. byte/short).

Expand Down