Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
maropu committed Dec 23, 2020
1 parent d205a13 commit b38541f
Showing 1 changed file with 17 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -422,25 +422,23 @@ abstract class BaseScriptTransformationSuite extends SparkPlanTest with SQLTestU
}

test("SPARK-32106: TRANSFORM with non-existent command/file") {
val e1 = intercept[SparkException] {
sql(
"""
|SELECT TRANSFORM(a)
|USING 'some_non_existent_command' AS (a)
|FROM VALUES (1) t(a)
""".stripMargin).collect()
}.getMessage
assert(e1.contains("Subprocess exited"))

val e2 = intercept[SparkException] {
sql(
"""
|SELECT TRANSFORM(a)
|USING 'python some_non_existent_file' AS (a)
|FROM VALUES (1) t(a)
""".stripMargin).collect()
}.getMessage
assert(e2.contains("Subprocess exited"))
Seq(
s"""
|SELECT TRANSFORM(a)
|USING 'some_non_existent_command' AS (a)
|FROM VALUES (1) t(a)
""".stripMargin,
s"""
|SELECT TRANSFORM(a)
|USING 'python some_non_existent_file' AS (a)
|FROM VALUES (1) t(a)
""".stripMargin).foreach { query =>
intercept[SparkException] {
// Since an error message is shell-dependent, this test just checks
// if the expected exception will be thrown.
sql(query).collect()
}
}
}
}

Expand Down

0 comments on commit b38541f

Please sign in to comment.