Skip to content

Commit

Permalink
2
Browse files Browse the repository at this point in the history
  • Loading branch information
morningman committed Sep 6, 2024
1 parent 7404aa8 commit aa0d6d6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,16 @@ public Optional<ExternalDatabase<? extends ExternalTable>> getDbForReplay(long d
}
}

/**
* Build a database instance.
* If checkExists is true, it will check if the database exists in the remote system.
*
* @param dbName
* @param dbId
* @param logType
* @param checkExists
* @return
*/
protected ExternalDatabase<? extends ExternalTable> buildDbForInit(String dbName, long dbId,
InitCatalogLog.Type logType, boolean checkExists) {
if (checkExists) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,13 @@ protected void handleInitDb(String fullDbName) {
if (catalogName != null) {
CatalogIf catalogIf = ctx.getEnv().getCatalogMgr().getCatalog(catalogName);
if (catalogIf == null) {
ctx.getState().setError(ErrorCode.ERR_BAD_DB_ERROR, "No match catalog in doris: " + fullDbName);
ctx.getState().setError(ErrorCode.ERR_BAD_DB_ERROR,
ErrorCode.ERR_BAD_DB_ERROR.formatErrorMsg(catalogName + "." + dbName));
return;
}
if (catalogIf.getDbNullable(dbName) == null) {
ctx.getState().setError(ErrorCode.ERR_BAD_DB_ERROR, "No match database in doris: " + fullDbName);
ctx.getState().setError(ErrorCode.ERR_BAD_DB_ERROR,
ErrorCode.ERR_BAD_DB_ERROR.formatErrorMsg(catalogName + "." + dbName));
return;
}
}
Expand Down

0 comments on commit aa0d6d6

Please sign in to comment.