spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cloud-fan <...@git.apache.org>
Subject [GitHub] spark pull request #16323: [SPARK-18911] [SQL] Define CatalogStatistics to i...
Date Fri, 23 Dec 2016 17:22:33 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message