File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ class SQLViewSuite extends QueryTest with SQLTestUtils with TestHiveSingleton {
5454 }
5555 }
5656
57- test(" error handling: existing a table with the duplicate name when creating a view" ) {
57+ test(" error handling: existing a table with the duplicate name when creating/altering a view" ) {
5858 withTable(" tab1" ) {
5959 sql(" CREATE TABLE tab1 (id int)" )
6060 var e = intercept[AnalysisException ] {
@@ -65,6 +65,10 @@ class SQLViewSuite extends QueryTest with SQLTestUtils with TestHiveSingleton {
6565 sql(" CREATE VIEW tab1 AS SELECT * FROM jt" )
6666 }.getMessage
6767 assert(e.contains(" The following is an existing table, not a view: `default`.`tab1`" ))
68+ e = intercept[AnalysisException ] {
69+ sql(" ALTER VIEW tab1 AS SELECT * FROM jt" )
70+ }.getMessage
71+ assert(e.contains(" The following is an existing table, not a view: `default`.`tab1`" ))
6872 }
6973 }
7074
You can’t perform that action at this time.
0 commit comments