Skip to content

Commit 0b194ca

Browse files
committed
Fix tests
1 parent 821e08a commit 0b194ca

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CodeGenerationSuite.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,9 @@ class CodeGenerationSuite extends SparkFunSuite with ExpressionEvalHelper {
448448
val ref = BoundReference(0, IntegerType, true)
449449
val add1 = Add(ref, ref)
450450
val add2 = Add(add1, add1)
451-
val dummy = SubExprEliminationState(VariableValue("dummy", "boolean"),
452-
VariableValue("dummy", "boolean"))
451+
val dummy = SubExprEliminationState(
452+
JavaCode.variable("dummy", BooleanType),
453+
JavaCode.variable("dummy", BooleanType))
453454

454455
// raw testing of basic functionality
455456
{

sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/codegen/ExprValueSuite.scala

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.apache.spark.sql.catalyst.expressions.codegen
1919

2020
import org.apache.spark.SparkFunSuite
21+
import org.apache.spark.sql.types.BooleanType
2122

2223
class ExprValueSuite extends SparkFunSuite {
2324

@@ -31,16 +32,7 @@ class ExprValueSuite extends SparkFunSuite {
3132
assert(trueLit.isPrimitive)
3233
assert(falseLit.isPrimitive)
3334

34-
trueLit match {
35-
case LiteralValue(value, javaType) =>
36-
assert(value == "true" && javaType == "boolean")
37-
case _ => fail()
38-
}
39-
40-
falseLit match {
41-
case LiteralValue(value, javaType) =>
42-
assert(value == "false" && javaType == "boolean")
43-
case _ => fail()
44-
}
35+
assert(trueLit === JavaCode.literal("true", BooleanType))
36+
assert(falseLit === JavaCode.literal("false", BooleanType))
4537
}
4638
}

0 commit comments

Comments
 (0)