morningman commented on code in PR #16271: URL: https://github.com/apache/doris/pull/16271#discussion_r1091406966
########## fe/fe-core/src/main/java/org/apache/doris/analysis/InsertStmt.java: ########## @@ -322,8 +331,15 @@ public void analyze(Analyzer analyzer) throws UserException { private void analyzeTargetTable(Analyzer analyzer) throws AnalysisException { // Get table if (targetTable == null) { - DatabaseIf db = Env.getCurrentInternalCatalog().getDbOrAnalysisException(tblName.getDb()); - targetTable = (Table) db.getTableOrAnalysisException(tblName.getTbl()); + DatabaseIf db = analyzer.getEnv().getCurrentCatalog().getDbOrAnalysisException(tblName.getDb()); Review Comment: `getCurrentInternalCatalog` only return `InternalCatalog`, no matter what is your current catalog is. But `getCurrentCatalog` will return the real current catalog(set by `switch` cmd) -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org