This is an automated email from the ASF dual-hosted git repository.

lijibing pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 15d32f329eb Make sure external table fetched dbId before call 
getRowCount. (#31379) (#31608)
15d32f329eb is described below

commit 15d32f329eb096fd81cf28c5719acddfe39a4778
Author: Jibing-Li <64681310+jibing...@users.noreply.github.com>
AuthorDate: Thu Feb 29 21:08:31 2024 +0800

    Make sure external table fetched dbId before call getRowCount. (#31379) 
(#31608)
---
 .../java/org/apache/doris/catalog/external/ExternalTable.java     | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/catalog/external/ExternalTable.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/external/ExternalTable.java
index 4abd66abd54..90188e18fed 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/catalog/external/ExternalTable.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/external/ExternalTable.java
@@ -284,6 +284,14 @@ public class ExternalTable implements TableIf, Writable, 
GsonPostProcessable {
 
     @Override
     public long getRowCount() {
+        // Return 0 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 0;
+        }
         // All external table should get external row count from cache.
         return 
Env.getCurrentEnv().getExtMetaCacheMgr().getRowCountCache().getCachedRowCount(catalog.getId(),
 dbId, id);
     }


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

Reply via email to