bowenli86 commented on a change in pull request #8636: 
[FLINK-12237][hive]Support Hive table stats related operations in HiveCatalog
URL: https://github.com/apache/flink/pull/8636#discussion_r298297462
 
 

 ##########
 File path: 
flink-table/flink-table-common/src/test/java/org/apache/flink/table/catalog/CatalogTest.java
 ##########
 @@ -1069,6 +1070,84 @@ public void testListPartitionPartialSpec() throws 
Exception {
                assertEquals(1, catalog.listPartitions(path1, 
createAnotherPartitionSpecSubset()).size());
        }
 
+
+       // ------ table and column stats ------
+
+       @Test
+       public void testGetTableStats_TableNotExistException() throws Exception{
+               catalog.createDatabase(db1, createDb(), false);
+               
exception.expect(org.apache.flink.table.catalog.exceptions.TableNotExistException.class);
+               catalog.getTableStatistics(path1);
+       }
+
+       @Test
+       public void testGetPartitionStats() throws Exception{
+               catalog.createDatabase(db1, createDb(), false);
+               catalog.createTable(path1, createPartitionedTable(), false);
+               catalog.createPartition(path1, createPartitionSpec(), 
createPartition(), false);
+               CatalogTableStatistics tableStatistics = 
catalog.getPartitionStatistics(path1, createPartitionSpec());
+               assertEquals(0, tableStatistics.getFileCount());
 
 Review comment:
   minor: use `HiveStatsUtil.DEFAULT_STATS_ZERO_CONST` as expected value?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to