Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14314#discussion_r71939503
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLViewSuite.scala 
---
    @@ -55,6 +54,76 @@ class SQLViewSuite extends QueryTest with SQLTestUtils 
with TestHiveSingleton {
         }
       }
     
    +  test("error handling: existing a table with the duplicate name when 
creating/altering a view") {
    +    withTable("tab1") {
    +      sql("CREATE TABLE tab1 (id int)")
    +      var e = intercept[AnalysisException] {
    +        sql("CREATE OR REPLACE VIEW tab1 AS SELECT * FROM jt")
    +      }.getMessage
    +      assert(e.contains("The following is an existing table, not a view: 
`default`.`tab1`"))
    +      e = intercept[AnalysisException] {
    +        sql("CREATE VIEW tab1 AS SELECT * FROM jt")
    --- End diff --
    
    ```
    hive> CREATE VIEW tab1 AS SELECT * FROM t1;
    FAILED: Execution Error, return code 1 from 
org.apache.hadoop.hive.ql.exec.DDLTask. AlreadyExistsException(message:Table 
tab1 already exists)
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to