Github user hvanhovell commented on a diff in the pull request:
https://github.com/apache/spark/pull/20981#discussion_r179420439
--- Diff:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ObjectExpressionsSuite.scala
---
@@ -277,4 +278,31 @@ class ObjectExpressionsSuite extends SparkFunSuite
with ExpressionEvalHelper {
checkEvaluation(decodeUsingSerializer, null,
InternalRow.fromSeq(Seq(null)))
}
}
+
+ test("LambdaVariable should support interpreted execution") {
+ val elementTypes = Seq(BooleanType, ByteType, ShortType, IntegerType,
LongType, FloatType,
+ DoubleType, DecimalType.USER_DEFAULT, StringType, BinaryType,
DateType, TimestampType,
+ CalendarIntervalType)
+ val arrayTypes = elementTypes.flatMap { elementType =>
+ Seq(ArrayType(elementType, containsNull = false),
ArrayType(elementType, containsNull = true))
+ }
+ val mapTypes = elementTypes.flatMap { elementType =>
+ Seq(MapType(elementType, elementType, false), MapType(elementType,
elementType, true))
+ }
+ val structTypes = elementTypes.flatMap { elementType =>
+ Seq(StructType(StructField("col1", elementType, false) :: Nil),
+ StructType(StructField("col1", elementType, true) :: Nil))
+ }
+
+ val acceptedTypes = elementTypes ++ arrayTypes ++ mapTypes ++
structTypes
+ val random = new Random()
--- End diff --
Please set a seed or use `withClue()` otherwise it will be very annoying to
debug these when something goes south.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]