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_r296989387
##########
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:
`hive> ANALYZE TABLE pt_products COMPUTE STATISTICS ;
FAILED: SemanticException [Error 10115]: Table is partitioned and partition
specification is needed`
I test it in the hive shell and it returns an error message.
----------------------------------------------------------------
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