bowenli86 commented on a change in pull request #8703: 
[FLINK-12807][hive]Support Hive table columnstats related operations in 
HiveCatalog
URL: https://github.com/apache/flink/pull/8703#discussion_r293925009
 
 

 ##########
 File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java
 ##########
 @@ -1074,15 +1074,14 @@ public void alterTableStatistics(ObjectPath tablePath, 
CatalogTableStatistics ta
        }
 
        @Override
-       public void alterTableColumnStatistics(ObjectPath tablePath, 
CatalogColumnStatistics columnStatistics, boolean ignoreIfNotExists) throws 
TableNotExistException, CatalogException {
+       public void alterTableColumnStatistics(ObjectPath tablePath, 
CatalogColumnStatistics columnStatistics, boolean ignoreIfNotExists) throws 
TableNotExistException, CatalogException, TableNotPartitionedException {
                try {
                        Table hiveTable = getHiveTable(tablePath);
                        // Set table column stats. This only works for 
non-partitioned tables.
                        if (!isTablePartitioned(hiveTable)) {
-                               
client.updateTableColumnStatistics(HiveCatalogUtil.createTableColumnStats(hiveTable,
 columnStatistics.getColumnStatisticsData()));
+                               
client.updateTableColumnStatistics(HiveStatsUtil.createTableColumnStats(hiveTable,
 columnStatistics.getColumnStatisticsData()));
                        } else {
-                               throw new 
CatalogException(String.format("Failed to alter partition table column stats of 
table %s",
-                                                                               
                                tablePath.getFullName()));
+                               throw new 
TableNotPartitionedException(getName(), tablePath);
 
 Review comment:
   shouldn't this be a `TablePartitionedException`? not 
`TableNotPartitionedException`
   
   we need to add a `TablePartitionedException.class`

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