Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix
  • Loading branch information
maropu committed Dec 23, 2020
commit b38541f330754c2aabe02a1307aa684d1b7c2f9a
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