Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
sunchao committed Nov 9, 2023
1 parent 1b6b0a5 commit e623a33
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto
}

val partitionDates = List("2010-01-01", "2010-01-02", "2010-01-03")
val expectedRowCount = 25

Seq(true, false).foreach { partitionStatsEnabled =>
withSQLConf(SQLConf.UPDATE_PART_STATS_IN_ANALYZE_TABLE_ENABLED.key ->
Expand Down Expand Up @@ -422,15 +421,15 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto

assert(getTableStats(tableName).sizeInBytes > 0)
// Table row count should be updated
assert(getTableStats(tableName).rowCount.get == 3 * expectedRowCount)
assert(getTableStats(tableName).rowCount.get > 0)

partitionDates.foreach { ds =>
val partStats = queryStats(ds)
if (partitionStatsEnabled) {
assert(partStats.nonEmpty)
// The scan option should update partition row count
assert(partStats.get.sizeInBytes > 0)
assert(partStats.get.rowCount.get == expectedRowCount)
assert(partStats.get.rowCount.get > 0)
} else {
assert(partStats.isEmpty)
}
Expand Down

0 comments on commit e623a33

Please sign in to comment.