// create a new session with base database name. If no database name is give, we use default database.
String databaseName = request.hasBaseDatabaseName() ? request.getBaseDatabaseName() : DEFAULT_DATABASE_NAME;
if (!context.getCatalog().existDatabase(databaseName)) {
LOG.info("Session creation is canceled due to absent base database \"" + databaseName + "\".");
throw new NoSuchDatabaseException(databaseName);
}
String sessionId =
context.getSessionManager().createSession(request.getUsername(), databaseName);
CreateSessionResponse.Builder builder = CreateSessionResponse.newBuilder();