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

    https://github.com/apache/spark/pull/12872#discussion_r62016314
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLViewSuite.scala 
---
    @@ -37,11 +37,21 @@ class SQLViewSuite extends QueryTest with SQLTestUtils 
with TestHiveSingleton {
         sqlContext.sql(s"DROP TABLE IF EXISTS jt")
       }
     
    -  test("nested views") {
    -    withView("jtv1", "jtv2") {
    +  test("nested views (interleaved with temporary views)") {
    +    withView("jtv1", "jtv2", "jtv3", "temp_jtv1", "temp_jtv2", 
"temp_jtv3") {
    --- End diff --
    
    Does `DROP VIEW` handles temporary view now? I guess not yet? If you check 
definition of `withView`, you may see that it uses `DROP VIEW` to clean up 
testing views. If `DROP VIEW` doesn't handle temporary views, `temp_jtv1` etc. 
won't be cleaned up. Currently you can make sure they are dropped using 
`withTempTable` (which is quite confusing, since temporary table and temporary 
view are really the same thing for now):
    
    ```scala
    withView("jtv1", "jtv2", "jtv3") {
      withTempTable("temp_jtv1", "temp_jtv2", "temp_jtv3") {
        // ...
      }
    }
    ```
    
    I'd suggest to make sure that `DROP VIEW` also handles temporary view in a 
follow-up PR. (Or maybe a dedicated `DROP TEMPORARY VIEW` DDL command?) Also, 
we should add a `withTempView` testing utility method in `SQLTestUtils`.


---
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