DanielZhu58 commented on code in PR #5578: URL: https://github.com/apache/hive/pull/5578#discussion_r1923093511
########## standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java: ########## @@ -1885,30 +1931,57 @@ public void testColumnStatistics() throws Throwable { colStats.setStatsObj(statsObjs); colStats.setEngine(ENGINE); - client.updatePartitionColumnStatistics(colStats); + client.updatePartitionColumnStatistics(colStats); - colStats2 = client.getPartitionColumnStatistics(dbName, tblName, + colStats2 = client.getPartitionColumnStatistics(dbName, tblName, Lists.newArrayList(partName), Lists.newArrayList(colName[1]), ENGINE).get(partName).get(0); - // compare stats obj to ensure what we get is what we wrote - assertNotNull(colStats2); - assertEquals(colStats.getStatsDesc().getPartName(), partName); - assertEquals(colStats2.getColName(), colName[1]); - assertEquals(colStats2.getStatsData().getStringStats().getMaxColLen(), maxColLen); - assertEquals(colStats2.getStatsData().getStringStats().getAvgColLen(), avgColLen, 0.01); - assertEquals(colStats2.getStatsData().getStringStats().getNumNulls(), numNulls); - assertEquals(colStats2.getStatsData().getStringStats().getNumDVs(), numDVs); - - // test stats deletion at partition level - client.deletePartitionColumnStatistics(dbName, tblName, partName, colName[1], ENGINE); - - colStats2 = client.getPartitionColumnStatistics(dbName, tblName, - Lists.newArrayList(partName), Lists.newArrayList(colName[0]), ENGINE).get(partName).get(0); - - // test get stats on a column for which stats doesn't exist - Map<String, List<ColumnStatisticsObj>> stats2 = client.getPartitionColumnStatistics(dbName, tblName, - Lists.newArrayList(partName), Lists.newArrayList(colName[1]), ENGINE); - assertTrue("stats are not empty: " + stats2, stats2.isEmpty()); + // compare stats obj to ensure what we get is what we wrote + assertNotNull(colStats2); Review Comment: Acknowledged. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org