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
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new bd41341a97a [bugfix](tvf)catch exception for fetching SchemaTableData
#34856
bd41341a97a is described below
commit bd41341a97a009a97d4f57f24a1e0cdf04720b8a
Author: wuwenchi <[email protected]>
AuthorDate: Tue May 14 23:40:13 2024 +0800
[bugfix](tvf)catch exception for fetching SchemaTableData #34856
---
.../datasource/iceberg/IcebergMetadataCache.java | 3 +++
.../apache/doris/service/FrontendServiceImpl.java | 23 +++++++++++++---------
2 files changed, 17 insertions(+), 9 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataCache.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataCache.java
index 67d6e6cb669..acda08b7378 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataCache.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataCache.java
@@ -72,6 +72,9 @@ public class IcebergMetadataCache {
public List<Snapshot> getSnapshotList(TIcebergMetadataParams params)
throws UserException {
CatalogIf catalog =
Env.getCurrentEnv().getCatalogMgr().getCatalog(params.getCatalog());
+ if (catalog == null) {
+ throw new UserException("The specified catalog does not exist:" +
params.getCatalog());
+ }
IcebergMetadataCacheKey key =
IcebergMetadataCacheKey.of(catalog, params.getDatabase(),
params.getTable());
return snapshotListCache.get(key);
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
b/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
index 68ecf1b08ec..6b262baa2e1 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
@@ -2303,15 +2303,20 @@ public class FrontendServiceImpl implements
FrontendService.Iface {
@Override
public TFetchSchemaTableDataResult
fetchSchemaTableData(TFetchSchemaTableDataRequest request) throws TException {
- if (!request.isSetSchemaTableName()) {
- return MetadataGenerator.errorResult("Fetch schema table name is
not set");
- }
- // tvf queries
- if (request.getSchemaTableName() == TSchemaTableName.METADATA_TABLE) {
- return MetadataGenerator.getMetadataTable(request);
- } else {
- // database information_schema's tables
- return MetadataGenerator.getSchemaTableData(request);
+ try {
+ if (!request.isSetSchemaTableName()) {
+ return MetadataGenerator.errorResult("Fetch schema table name
is not set");
+ }
+ // tvf queries
+ if (request.getSchemaTableName() ==
TSchemaTableName.METADATA_TABLE) {
+ return MetadataGenerator.getMetadataTable(request);
+ } else {
+ // database information_schema's tables
+ return MetadataGenerator.getSchemaTableData(request);
+ }
+ } catch (Exception e) {
+ LOG.warn("Failed to fetchSchemaTableData", e);
+ return MetadataGenerator.errorResult(e.getMessage());
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]