You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "xubo245 (JIRA)" <ji...@apache.org> on 2018/01/11 03:14:00 UTC

[jira] [Created] (SPARK-23036) Add withGlobalTempView for testing

xubo245 created SPARK-23036:
-------------------------------

             Summary: Add withGlobalTempView for testing
                 Key: SPARK-23036
                 URL: https://issues.apache.org/jira/browse/SPARK-23036
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 2.2.1
            Reporter: xubo245


Add withGlobalTempView when create global temp view, like withTempView and withView.

And correct some improper usage like: 
{code:java}
 test("list global temp views") {
    try {
      sql("CREATE GLOBAL TEMP VIEW v1 AS SELECT 3, 4")
      sql("CREATE TEMP VIEW v2 AS SELECT 1, 2")

      checkAnswer(sql(s"SHOW TABLES IN $globalTempDB"),
        Row(globalTempDB, "v1", true) ::
        Row("", "v2", true) :: Nil)

      assert(spark.catalog.listTables(globalTempDB).collect().toSeq.map(_.name) == Seq("v1", "v2"))
    } finally {
      spark.catalog.dropTempView("v1")
      spark.catalog.dropGlobalTempView("v2")
    }
  }
{code}




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org