Jibing-Li commented on code in PR #31276:
URL: https://github.com/apache/doris/pull/31276#discussion_r1498944776


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalTable.java:
##########
@@ -297,10 +297,16 @@ public String getMysqlType() {
 
     @Override
     public long getRowCount() {
-        return 0;
+        // All external table should get external row count from cache.
+        return 
Env.getCurrentEnv().getExtMetaCacheMgr().getRowCountCache().getCachedRowCount(catalog.getId(),
 dbId, id);
     }
 
-    public long getCacheRowCount() {
+    @Override
+    /**
+     * Default return 0. Subclass need to implement this interface.
+     * This is called by ExternalRowCountCache to load row count cache.
+     */
+    public long fetchRowCount() {
         return 0;
     }

Review Comment:
   I feel it's OK to keep this default implementation, so we don't need to copy 
the code to each subclass. For tables not implement this function, get 0 value 
is acceptable. These tables will get correct row count only if they are 
analyzed. 



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to