You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2024/02/28 05:09:07 UTC
(doris) 01/22: Make sure external table fetched dbId before call getRowCount. (#31379)
This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
commit 37590f177824ee1be99381a0d17b57b6983a65f4
Author: Jibing-Li <64...@users.noreply.github.com>
AuthorDate: Tue Feb 27 16:41:56 2024 +0800
Make sure external table fetched dbId before call getRowCount. (#31379)
---
.../src/main/java/org/apache/doris/datasource/ExternalTable.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalTable.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalTable.java
index ce3220a05f9..a84f637cd24 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalTable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalTable.java
@@ -297,6 +297,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.name, 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-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org