Skip to content

Commit 9e04c6e

Browse files
committed
Add test for non-existent table.
1 parent f701daa commit 9e04c6e

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,6 @@ class Analyzer(
981981
* the table identifier does not include a catalog.
982982
*/
983983
object ResolveDescribeTable extends Rule[LogicalPlan] {
984-
import org.apache.spark.sql.catalog.v2.CatalogV2Implicits._
985984
override def apply(plan: LogicalPlan): LogicalPlan = plan resolveOperators {
986985
case describe @ DescribeTableStatement(
987986
CatalogObjectIdentifier(Some(v2Catalog), ident), _, isExtended) =>

sql/core/src/test/scala/org/apache/spark/sql/sources/v2/DataSourceV2SQLSuite.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ class DataSourceV2SQLSuite extends QueryTest with SharedSQLContext with BeforeAn
8787
Row("data", "string", "")))
8888
}
8989

90+
test("DescribeTable with v2 catalog when table does not exist.") {
91+
intercept[AnalysisException] {
92+
spark.sql("DESCRIBE TABLE testcat.table_name")
93+
}
94+
}
95+
9096
test("DescribeTable extended using v2 catalog") {
9197
spark.sql("CREATE TABLE testcat.table_name (id bigint, data string)" +
9298
" USING foo" +

0 commit comments

Comments
 (0)