Skip to content

Commit

Permalink
[bugfix](tvf)catch exception for fetching SchemaTableData for 2.0 (#3…
Browse files Browse the repository at this point in the history
  • Loading branch information
wuwenchi authored May 22, 2024
1 parent 9b258b6 commit 2ef077e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ public 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.getId(), params.getDatabase(), params.getTable());
List<Snapshot> ifPresent = snapshotListCache.getIfPresent(key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2234,13 +2234,18 @@ public TFrontendPingFrontendResult ping(TFrontendPingFrontendRequest request) th

@Override
public TFetchSchemaTableDataResult fetchSchemaTableData(TFetchSchemaTableDataRequest request) throws TException {
switch (request.getSchemaTableName()) {
case METADATA_TABLE:
return MetadataGenerator.getMetadataTable(request);
default:
break;
try {
switch (request.getSchemaTableName()) {
case METADATA_TABLE:
return MetadataGenerator.getMetadataTable(request);
default:
break;
}
return MetadataGenerator.errorResult("Fetch schema table name is not set");
} catch (Exception e) {
LOG.warn("Failed to fetchSchemaTableData", e);
return MetadataGenerator.errorResult(e.getMessage());
}
return MetadataGenerator.errorResult("Fetch schema table name is not set");
}

private TNetworkAddress getClientAddr() {
Expand Down

0 comments on commit 2ef077e

Please sign in to comment.