Github user wzhfy commented on a diff in the pull request: https://github.com/apache/spark/pull/14712#discussion_r75569715 --- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/StatisticsSuite.scala --- @@ -168,6 +170,57 @@ class StatisticsSuite extends QueryTest with TestHiveSingleton with SQLTestUtils TableIdentifier("tempTable"), ignoreIfNotExists = true, purge = false) } + test("generate table-level statistics") { + def checkTableStats( + statsSeq: Seq[Statistics], + sizeInBytes: Int, + estimatedSize: Int, + rowCount: Int): Unit = { + assert(statsSeq.size === 1) + assert(statsSeq.head.sizeInBytes === BigInt(sizeInBytes)) + assert(statsSeq.head.estimatedSize === Some(BigInt(estimatedSize))) + assert(statsSeq.head.rowCount === Some(BigInt(rowCount))) + } + + sql("CREATE TABLE analyzeTable (key STRING, value STRING)").collect() --- End diff -- I'll modify unit tests based on your comments, thanks!
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org