DanielZhu58 commented on code in PR #5578: URL: https://github.com/apache/hive/pull/5578#discussion_r1923089005
########## standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java: ########## @@ -1856,6 +1859,49 @@ public void testColumnStatistics() throws Throwable { colStats2 = client.getTableColumnStatistics( dbName, tblName, Lists.newArrayList(colName[0]), ENGINE).get(0); + // test delete column stats; if no col name is passed all column stats associated with the + // table is deleted + status = client.deleteTableColumnStatistics(dbName, tblName, colName[0], ENGINE); + assertTrue(status); + // try to query stats for a column for which stats doesn't exist + stats = client.getTableColumnStatistics( + dbName, tblName, Lists.newArrayList(colName[0]), ENGINE); + assertTrue("stats are not empty: " + stats, stats.isEmpty()); + + // reset the column stats + client.updateTableColumnStatistics(colStats); + // test delete multiple column stats(column names can be null, or one, or multiple) + // case 1: column names are null, all column stats should be deleted + status = client.deleteTableMultiColumnStatistics(dbName, tblName, null, ENGINE); + assertTrue(status); + stats = client.getTableColumnStatistics( + dbName, tblName, Lists.newArrayList(colName[0]), ENGINE); + assertTrue("stats are not empty: " + stats, stats.isEmpty()); + stats = client.getTableColumnStatistics( + dbName, tblName, Lists.newArrayList(colName[1]), ENGINE); + assertTrue("stats are not empty: " + stats, stats.isEmpty()); + + client.updateTableColumnStatistics(colStats); Review Comment: I am not sure if I understand this. In this test file, we are testing 3 cases. (Columns names amount are null, 1, or multiple) -- 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