hubgeter commented on code in PR #41659:
URL: https://github.com/apache/doris/pull/41659#discussion_r1796475626


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalTable.java:
##########
@@ -114,6 +114,11 @@ public boolean isView() {
         return false;
     }
 
+    public boolean checkInitialized() {

Review Comment:
   i will remove this method.



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalTable.java:
##########
@@ -203,14 +208,15 @@ public long getRowCount() {
 
     @Override
     public long getCachedRowCount() {
-        // Return -1 if makeSureInitialized throw exception.
-        // For example, init hive table may throw NotSupportedException.
-        try {
-            makeSureInitialized();
-        } catch (Exception e) {
-            LOG.warn("Failed to initialize table {}.{}.{}", catalog.getName(), 
dbName, name, e);
-            return -1;
+        // Return -2 if uninitialized.
+        // Before this, for uninitialized tables, we would call 
makeSureInitialized(), just like the implementation of
+        // ExternalTable.getRowCount(), but this is not very meaningful and 
time-consuming.
+        // The getCachedRowCount() function is only used when `show table` and 
querying `information_schema.tables`.
+        if (!checkInitialized()) {
+            return -2;

Review Comment:
   i will fix it 



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to