Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17055#discussion_r105473200
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala 
---
    @@ -1663,95 +1663,127 @@ class HiveDDLSuite
         }
       }
     
    +  test("create hive table with a non-existing location") {
    +    withTable("t", "t1") {
    +      withTempPath { dir =>
    +        spark.sql(s"CREATE TABLE t(a int, b int) USING hive LOCATION 
'$dir'")
    +
    +        val table = 
spark.sessionState.catalog.getTableMetadata(TableIdentifier("t"))
    +        assert(table.location == makeQualifiedPath(dir.getAbsolutePath))
    +
    +        spark.sql("INSERT INTO TABLE t SELECT 1, 2")
    +        assert(dir.exists())
    +
    +        checkAnswer(spark.table("t"), Row(1, 2))
    +      }
    +      // partition table
    +      withTempPath { dir =>
    +        spark.sql(
    +          s"""
    +             |CREATE TABLE t1(a int, b int)
    +             |USING hive
    +             |PARTITIONED BY(a)
    +             |LOCATION '$dir'
    +           """.stripMargin)
    +
    +        val table = 
spark.sessionState.catalog.getTableMetadata(TableIdentifier("t1"))
    +        assert(table.location == makeQualifiedPath(dir.getAbsolutePath))
    +
    +        spark.sql("INSERT INTO TABLE t1 PARTITION(a=1) SELECT 2")
    +
    +        val partDir = new File(dir, "a=1")
    +        assert(partDir.exists())
    +
    +        checkAnswer(spark.table("t1"), Row(2, 1))
    +      }
    +    }
    +  }
    +
       Seq(true, false).foreach { shouldDelete =>
    -    val tcName = if (shouldDelete) "non-existent" else "existed"
    +    val tcName = if (shouldDelete) "non-existing" else "existed"
         test(s"CTAS for external data source table with a $tcName location") {
    --- End diff --
    
    now it's duplicated with 
https://github.com/apache/spark/pull/17055/files#diff-2d45592564aa2eea4e85ffd000d8a14eR2054


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to