Skip to content

Commit d3b9cec

Browse files
committed
fix failed UT
1 parent 6a7438b commit d3b9cec

File tree

2 files changed

+1
-41
lines changed

2 files changed

+1
-41
lines changed

sql/core/src/test/scala/org/apache/spark/sql/execution/BaseScriptTransformationSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ abstract class BaseScriptTransformationSuite extends SparkPlanTest with SQLTestU
304304
child = child,
305305
ioschema = defaultIOSchema
306306
),
307-
df.select('a, 'b.cast("string"), 'c.cast("string"), 'd.cast("string"), 'e).collect())
307+
df.select('a, 'b, 'c, 'd, 'e).collect())
308308
}
309309
}
310310

sql/core/src/test/scala/org/apache/spark/sql/execution/SparkScriptTransformationSuite.scala

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -59,44 +59,4 @@ class SparkScriptTransformationSuite extends BaseScriptTransformationSuite with
5959
assert(e.contains("TRANSFORM with serde is only supported in hive mode"))
6060
}
6161
}
62-
63-
test("SPARK-32106: TRANSFORM doesn't support ArrayType/MapType/StructType " +
64-
"as output data type (no serde)") {
65-
assume(TestUtils.testCommandAvailable("/bin/bash"))
66-
// check for ArrayType
67-
val e1 = intercept[SparkException] {
68-
sql(
69-
"""
70-
|SELECT TRANSFORM(a)
71-
|USING 'cat' AS (a array<int>)
72-
|FROM VALUES (array(1, 1), map('1', 1), struct(1, 'a')) t(a, b, c)
73-
""".stripMargin).collect()
74-
}.getMessage
75-
assert(e1.contains("SparkScriptTransformation without serde does not support" +
76-
" ArrayType as output data type"))
77-
78-
// check for MapType
79-
val e2 = intercept[SparkException] {
80-
sql(
81-
"""
82-
|SELECT TRANSFORM(b)
83-
|USING 'cat' AS (b map<int, string>)
84-
|FROM VALUES (array(1, 1), map('1', 1), struct(1, 'a')) t(a, b, c)
85-
""".stripMargin).collect()
86-
}.getMessage
87-
assert(e2.contains("SparkScriptTransformation without serde does not support" +
88-
" MapType as output data type"))
89-
90-
// check for StructType
91-
val e3 = intercept[SparkException] {
92-
sql(
93-
"""
94-
|SELECT TRANSFORM(c)
95-
|USING 'cat' AS (c struct<col1:int, col2:string>)
96-
|FROM VALUES (array(1, 1), map('1', 1), struct(1, 'a')) t(a, b, c)
97-
""".stripMargin).collect()
98-
}.getMessage
99-
assert(e3.contains("SparkScriptTransformation without serde does not support" +
100-
" StructType as output data type"))
101-
}
10262
}

0 commit comments

Comments
 (0)