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

 ##########
 File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java
 ##########
 @@ -1060,21 +1061,73 @@ private static Function 
instantiateHiveFunction(ObjectPath functionPath, HiveCat
                );
        }
 
+       private boolean isTablePartitioned(Table hiveTable) {
+               return hiveTable.getPartitionKeysSize() != 0;
+       }
+
        // ------ stats ------
 
        @Override
        public void alterTableStatistics(ObjectPath tablePath, 
CatalogTableStatistics tableStatistics, boolean ignoreIfNotExists) throws 
TableNotExistException, CatalogException {
-
+               try {
+                       Table hiveTable = getHiveTable(tablePath);
+                       // Set table stats
+                       if (needToUpdateStatistics(tableStatistics, 
hiveTable.getParameters())) {
+                               updateStatisticsParameters(tableStatistics, 
hiveTable.getParameters());
+                               client.alter_table(tablePath.getDatabaseName(), 
tablePath.getObjectName(), hiveTable);
 
 Review comment:
   No, i haven't tested this with Hive-1.2.1, since you have added a shim for 
it, I'll add it also.

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