Skip to content

Commit 14fd95d

Browse files
committed
Add a unit test.
1 parent e3c1970 commit 14fd95d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2598,4 +2598,12 @@ class SQLQuerySuite extends QueryTest with SharedSQLContext {
25982598
}
25992599
assert(!jobStarted.get(), "Command should not trigger a Spark job.")
26002600
}
2601+
2602+
test("SPARK-20164: AnalysisException should be tolerant to null query plan") {
2603+
try {
2604+
throw new AnalysisException("", None, None, plan = null)
2605+
} catch {
2606+
case ae: AnalysisException => assert(ae.plan == null && ae.getMessage == ae.getSimpleMessage)
2607+
}
2608+
}
26012609
}

0 commit comments

Comments
 (0)