[bugfix](tvf)catch exception for fetching SchemaTableData #34856
This commit is contained in:
@ -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);
|
||||
|
||||
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user