bowenli86 commented on a change in pull request #8314: [FLINK-12365][table] Add 
stats related catalog APIs
URL: https://github.com/apache/flink/pull/8314#discussion_r279523176
 
 

 ##########
 File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/ReadableCatalog.java
 ##########
 @@ -224,4 +224,54 @@ CatalogPartition getPartition(ObjectPath tablePath, 
CatalogPartitionSpec partiti
         */
        boolean functionExists(ObjectPath functionPath) throws CatalogException;
 
+       // ------ Statistics ------
+
+       /**
+        * Get the statistics of a table.
+        *
+        * @param tablePath path of the table
+        * @return the statistics of the given table, null if its statistics 
don't exist or are unknown.
 
 Review comment:
   Stats should probably always exist. It's how Hive handles it. Also, the 
behavior of "returns null when the stats doesn't exist" doesn't seem to match 
behaviors of other metadata APIs and would confuse people, for example 
`getTable()` throws `TableNotExistException` when the request table doesn't 
exist. It's just the default, "unknown" stats will be with some default value, 
for example, rowCount, fileCount, totalSize will all be 0.
   
   This will also better explain the signatures of these APIs.
   
   What do you think?

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