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_r293544015
########## File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java ########## @@ -1089,7 +1130,20 @@ public CatalogTableStatistics getTableStatistics(ObjectPath tablePath) throws Ta @Override public CatalogColumnStatistics getTableColumnStatistics(ObjectPath tablePath) throws TableNotExistException, CatalogException { - throw new UnsupportedOperationException(); + Table hiveTable = getHiveTable(tablePath); + try { + if (!isTablePartitioned(hiveTable)) { + List<ColumnStatisticsObj> columnStatisticsObjs = client.getTableColumnStatistics( + hiveTable.getDbName(), hiveTable.getTableName(), getFieldNames(hiveTable.getSd().getCols())); + return new CatalogColumnStatistics(HiveCatalogUtil.createCatalogColumnStats(columnStatisticsObjs)); + } else { + // TableStats of partitioned table is unknown, the behavior is same as HIVE Review comment: update the comment? e.g. "table column 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: us...@infra.apache.org With regards, Apache Git Services