Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
maropu committed May 31, 2020
1 parent 6008bc2 commit fe943f6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class InvokeTargetClass extends Serializable {
def filterInt(e: Any): Any = e.asInstanceOf[Int] > 0
def filterPrimitiveInt(e: Int): Boolean = e > 0
def binOp(e1: Int, e2: Double): Double = e1 + e2
def mapFunc(e: Any): Tuple2[Any, Any] = (e, e)
}

class InvokeTargetSubClass extends InvokeTargetClass {
Expand Down Expand Up @@ -203,20 +202,6 @@ class ObjectExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
Invoke(funcSubObj, "binOp", DoubleType, inputSum), 0.75, InternalRow.apply(1, 0.25))
}

test("SPARK-31854: Invoke in MapElementsExec should not propagate null") {
val targetObject = new InvokeTargetClass
val funcClass = classOf[InvokeTargetClass]
val funcObj = Literal.create(targetObject, ObjectType(funcClass))
val inputInt = Seq(BoundReference(0, ObjectType(classOf[Any]), true))
val outputType = ObjectType(classOf[(Any, Any)])
val inputRow = InternalRow.fromSeq(Seq(null.asInstanceOf[java.lang.Integer]))
val createExpr = (propagateNull: Boolean) => {
Invoke(funcObj, "mapFunc", outputType, inputInt, propagateNull)
}
checkObjectExprEvaluation(createExpr(true), null, inputRow)
checkObjectExprEvaluation(createExpr(false), (null, null), inputRow)
}

test("SPARK-23593: InitializeJavaBean should support interpreted execution") {
val list = new java.util.LinkedList[Int]()
list.add(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1918,7 +1918,6 @@ class DatasetSuite extends QueryTest
}

test("SPARK-31854: Invoke in MapElementsExec should not propagate null") {
spark.conf.set("spark.sql.codegen.wholeStage", false)
Seq("true", "false").foreach { wholeStage =>
withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> wholeStage) {
val ds = Seq(1.asInstanceOf[Integer], null.asInstanceOf[Integer]).toDS()
Expand Down

0 comments on commit fe943f6

Please sign in to comment.