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

    https://github.com/apache/spark/pull/16323#discussion_r93786594
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/StatisticsCollectionSuite.scala ---
    @@ -260,4 +261,46 @@ abstract class StatisticsCollectionTestBase extends 
QueryTest with SQLTestUtils
           }
         }
       }
    +
    +  // This test will be run twice: with and without Hive support
    +  test("conversion from CatalogStatistics to Statistics") {
    +    withTable("ds_tbl", "hive_tbl") {
    +      // Test data source table
    +      checkStatsConversion(tableName = "ds_tbl", isDatasourceTable = true)
    +      // Test hive serde table
    +      if (spark.conf.get(StaticSQLConf.CATALOG_IMPLEMENTATION) == "hive") {
    +        checkStatsConversion(tableName = "hive_tbl", isDatasourceTable = 
false)
    +      }
    +    }
    +  }
    +
    +  private def checkStatsConversion(tableName: String, isDatasourceTable: 
Boolean): Unit = {
    +    // Create an empty table and run analyze command on it.
    +    val col = "c1"
    +    val createTableSql = if (isDatasourceTable) {
    +      s"CREATE TABLE $tableName ($col INT) USING PARQUET"
    --- End diff --
    
    let's create a table with 2 columns, and only analyze one column, to see if 
the `attributeStats` only contains one entry.


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