stalary commented on code in PR #14518:
URL: https://github.com/apache/doris/pull/14518#discussion_r1037697399
##########
fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/TableSchemaAction.java:
##########
@@ -67,41 +77,74 @@ protected Object schema(
String fullDbName = getFullDbName(dbName);
// check privilege for select, otherwise return 401 HTTP status
checkTblAuth(ConnectContext.get().getCurrentUserIdentity(),
fullDbName, tblName, PrivPredicate.SELECT);
- OlapTable table;
+ CatalogIf catalog;
+ DatabaseIf db;
+ TableIf table;
try {
- Database db =
Env.getCurrentInternalCatalog().getDbOrMetaException(fullDbName);
- table = (OlapTable) db.getTableOrMetaException(tblName,
Table.TableType.OLAP);
- } catch (MetaNotFoundException e) {
+ catalog =
Env.getCurrentEnv().getCatalogMgr().getCatalog(InternalCatalog.INTERNAL_CATALOG_NAME);
+ db = catalog.getDbOrAnalysisException(fullDbName);
+ table = db.getTableOrAnalysisException(tblName);
Review Comment:
Can we use `db.getTableOrMetaException(tblName)`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]