morrySnow commented on code in PR #32853:
URL: https://github.com/apache/doris/pull/32853#discussion_r1539023024
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalCatalogRelation.java:
##########
@@ -81,13 +82,24 @@ public TableIf getTable() {
public DatabaseIf getDatabase() throws AnalysisException {
Preconditions.checkArgument(!qualifier.isEmpty(), "qualifier can not
be empty");
try {
- CatalogIf catalog = qualifier.size() == 3
- ?
Env.getCurrentEnv().getCatalogMgr().getCatalogOrException(qualifier.get(0),
- s -> new Exception("Catalog [" + qualifier.get(0) + "]
does not exist."))
- : Env.getCurrentEnv().getCurrentCatalog();
- return catalog.getDbOrException(qualifier.size() == 3 ?
qualifier.get(1) : qualifier.get(0),
- s -> new Exception("Database [" + qualifier.get(1) + "]
does not exist in catalog ["
- + qualifier.get(0) + "]."));
+ int len = qualifier.size();
+ if (2 == len) {
+ CatalogIf<DatabaseIf> catalog =
Env.getCurrentEnv().getCatalogMgr().getCatalogOrException(qualifier.get(0),
+ s -> new Exception("Catalog [" + qualifier.get(0) + "]
does not exist."));
+ return catalog.getDbOrException(qualifier.get(1),
Review Comment:
add getDbOrNereidsAnalysisException to catalog?
--
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]