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_r293931882
 
 

 ##########
 File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java
 ##########
 @@ -1083,8 +1136,14 @@ public void alterPartitionColumnStatistics(ObjectPath 
tablePath, CatalogPartitio
        }
 
        @Override
-       public CatalogTableStatistics getTableStatistics(ObjectPath tablePath) 
throws TableNotExistException, CatalogException {
-               throw new UnsupportedOperationException();
+       public CatalogTableStatistics getTableStatistics(ObjectPath tablePath) 
throws TableNotExistException,
+                       CatalogException, TableNotPartitionedException {
+               Table hiveTable = getHiveTable(tablePath);
+               if (!isTablePartitioned(hiveTable)) {
+                       return 
createCatalogTableStatistics(hiveTable.getParameters());
+               } else {
+                       throw new TableNotPartitionedException(getName(), 
tablePath);
 
 Review comment:
   First, shouldn't this be a `TablePartitionedException`?
   Second, please correct me if I'm wrong, IIRC, if the table is partitioned, 
wouldn't Hive client return unknown stats?

----------------------------------------------------------------
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