Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20705#discussion_r171668693
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala 
---
    @@ -516,24 +516,19 @@ class SQLQuerySuite extends QueryTest with 
SQLTestUtils with TestHiveSingleton {
       test("CTAS with default fileformat") {
         val table = "ctas1"
         val ctas = s"CREATE TABLE IF NOT EXISTS $table SELECT key k, value 
FROM src"
    -    withSQLConf(SQLConf.CONVERT_CTAS.key -> "true") {
    -      withSQLConf("hive.default.fileformat" -> "textfile") {
    +    Seq("orc", "parquet").foreach { dataSourceFormat =>
    +      withSQLConf(
    +        SQLConf.CONVERT_CTAS.key -> "true",
    +        SQLConf.DEFAULT_DATA_SOURCE_NAME.key -> dataSourceFormat,
    +        "hive.default.fileformat" -> "textfile") {
             withTable(table) {
               sql(ctas)
    -          // We should use parquet here as that is the default datasource 
fileformat. The default
    -          // datasource file format is controlled by 
`spark.sql.sources.default` configuration.
    +          // The default datasource file format is controlled by 
`spark.sql.sources.default`.
               // This testcase verifies that setting `hive.default.fileformat` 
has no impact on
               // the target table's fileformat in case of CTAS.
    -          assert(sessionState.conf.defaultDataSourceName === "parquet")
    -          checkRelation(tableName = table, isDataSourceTable = true, 
format = "parquet")
    +          checkRelation(tableName = table, isDataSourceTable = true, 
format = dataSourceFormat)
             }
           }
    --- End diff --
    
    Previously, `spark.sql.source.default=orc` with 
`hive.default.fileformat=textfile` is not tested properly.


---

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

Reply via email to