Code review comment: Yes. The insert stmt's database would be set as the current database.

Code under review:
public static void analyze(CreatePipeStmt stmt, ConnectContext context) {
        analyzeProperties(stmt.getProperties());
        Map<String, String> properties = stmt.getProperties();

        InsertStmt insertStmt = stmt.getInsertStmt();
        stmt.setTargetTable(insertStmt.getTableName());
        String insertSql = stmt.getOrigStmt().originStmt.substring(stmt.getInsertSqlStartIndex());
        stmt.setInsertSql(insertSql);
        InsertAnalyzer.analyze(insertStmt, context);

        analyzePipeName(stmt.getPipeName(), insertStmt.getTableName().getDb());

        
        if (!Strings.isNullOrEmpty(insertStmt.getLabel())) {
            ErrorReport.reportSemanticException(ErrorCode.ERR_BAD_PIPE_STATEMENT, "INSERT INTO cannot with label");
        }
        if (insertStmt.isOverwrite()) {
            ErrorReport.reportSemanticException(ErrorCode.ERR_BAD_PIPE_STATEMENT, "INSERT INTO cannot be OVERWRITE");
        }
        QueryStatement queryStatement = insertStmt.getQueryStatement();
        if (!(queryStatement.getQueryRelation() instanceof SelectRelation)) {
            ErrorReport.reportSemanticException(ErrorCode.ERR_BAD_PIPE_STATEMENT, "must be select statement");
        }
        SelectRelation selectRelation = (SelectRelation) queryStatement.getQueryRelation();
        if (selectRelation.hasAggregation() || selectRelation.hasOrderByClause() || selectRelation.hasLimit()) {
            ErrorReport.reportSemanticException(ErrorCode.ERR_BAD_PIPE_STATEMENT, "must be a vanilla select statement");
        }
        if (!(selectRelation.getRelation() instanceof FileTableFunctionRelation)) {
            ErrorReport.reportSemanticException(ErrorCode.ERR_BAD_PIPE_STATEMENT, "only support FileTableFunction");
        }
        FileTableFunctionRelation tableFunctionRelation = (FileTableFunctionRelation) selectRelation.getRelation();
        Table rawTable = tableFunctionRelation.getTable();
        if (rawTable == null || rawTable.getType() != Table.TableType.TABLE_FUNCTION) {
            ErrorReport.reportSemanticException(ErrorCode.ERR_BAD_PIPE_STATEMENT, "only support FileTableFunction");
        }

        if (!stmt.getPipeName().getDbName().equalsIgnoreCase(insertStmt.getTableName().getDb())) {
            ErrorReport.reportSemanticException(ErrorCode.ERR_BAD_PIPE_STATEMENT,
                    String.format("pipe's database [%s] and target table's database [%s] should be the same ignoring case",
                            stmt.getPipeName().getDbName(), insertStmt.getTableName().getDb()));
        }

        TableFunctionTable sourceTable = (TableFunctionTable) rawTable;
        stmt.setDataSource(
                new FilePipeSource(sourceTable.getPath(), sourceTable.getFormat(), sourceTable.getProperties()));
    }

Line commented on: analyzePipeName(stmt.getPipeName(), insertStmt.getTableName().getDb());

Revised code:
public static void analyze(CreatePipeStmt stmt, ConnectContext context) {
        analyzeProperties(stmt.getProperties());
        Map<String, String> properties = stmt.getProperties();

        InsertStmt insertStmt = stmt.getInsertStmt();
        stmt.setTargetTable(insertStmt.getTableName());
        String insertSql = stmt.getOrigStmt().originStmt.substring(stmt.getInsertSqlStartIndex());
        stmt.setInsertSql(insertSql);
        InsertAnalyzer.analyze(insertStmt, context);

        analyzePipeName(stmt.getPipeName(), insertStmt.getTableName().getDb());

        if (!stmt.getPipeName().getDbName().equalsIgnoreCase(insertStmt.getTableName().getDb())) {
            ErrorReport.reportSemanticException(ErrorCode.ERR_BAD_PIPE_STATEMENT,
                    String.format("pipe's database [%s] and target table's database [%s] should be the same",
                            stmt.getPipeName().getDbName(), insertStmt.getTableName().getDb()));
        }

        
        if (!Strings.isNullOrEmpty(insertStmt.getLabel())) {
            ErrorReport.reportSemanticException(ErrorCode.ERR_BAD_PIPE_STATEMENT, "INSERT INTO cannot with label");
        }
        if (insertStmt.isOverwrite()) {
            ErrorReport.reportSemanticException(ErrorCode.ERR_BAD_PIPE_STATEMENT, "INSERT INTO cannot be OVERWRITE");
        }
        QueryStatement queryStatement = insertStmt.getQueryStatement();
        if (!(queryStatement.getQueryRelation() instanceof SelectRelation)) {
            ErrorReport.reportSemanticException(ErrorCode.ERR_BAD_PIPE_STATEMENT, "must be select statement");
        }
        SelectRelation selectRelation = (SelectRelation) queryStatement.getQueryRelation();
        if (selectRelation.hasAggregation() || selectRelation.hasOrderByClause() || selectRelation.hasLimit()) {
            ErrorReport.reportSemanticException(ErrorCode.ERR_BAD_PIPE_STATEMENT, "must be a vanilla select statement." +
                    " Aggregation, order by clause, limit clause are not supported yet.");
        }
        if (!(selectRelation.getRelation() instanceof FileTableFunctionRelation)) {
            ErrorReport.reportSemanticException(ErrorCode.ERR_BAD_PIPE_STATEMENT, "only support FileTableFunction");
        }
        FileTableFunctionRelation tableFunctionRelation = (FileTableFunctionRelation) selectRelation.getRelation();
        Table rawTable = tableFunctionRelation.getTable();
        if (rawTable == null || rawTable.getType() != Table.TableType.TABLE_FUNCTION) {
            ErrorReport.reportSemanticException(ErrorCode.ERR_BAD_PIPE_STATEMENT, "only support FileTableFunction");
        }

        TableFunctionTable sourceTable = (TableFunctionTable) rawTable;
        stmt.setDataSource(
                new FilePipeSource(sourceTable.getPath(), sourceTable.getFormat(), sourceTable.getProperties()));
    }