public void createPipe(CreatePipeStmt stmt) throws DdlException {
        try {
            lock.writeLock().lock();
            Pair<Long, String> dbIdAndName = resolvePipeNameUnlock(stmt.getPipeName());
            boolean existed = nameToId.containsKey(dbIdAndName);
            if (existed) {
                if (!stmt.isIfNotExists() && !stmt.isReplace()) {
                    ErrorReport.reportSemanticException(ErrorCode.ERR_PIPE_EXISTS);
                }
                if (stmt.isIfNotExists()) {
                    return;
                } else if (stmt.isReplace()) {
                    LOG.info("Pipe {} already exist, replace it with a new one", stmt.getPipeName());
                    Pipe pipe = pipeMap.get(nameToId.get(dbIdAndName));
                    dropPipeImpl(pipe);
                }
            }

            // Add pipe
            long id = GlobalStateMgr.getCurrentState().getNextId();
            Pipe pipe = Pipe.fromStatement(id, stmt);
            putPipe(pipe);

            repo.addPipe(pipe);
        } finally {
            lock.writeLock().unlock();
        }

    }
@Test
    public void testInspectPipes() throws Exception {
        ConnectContext newCtx = UtFrameUtils.initCtxForNewPrivilege(UserIdentity.ROOT);
        newCtx.setDatabase(PIPE_TEST_DB);
        newCtx.setThreadLocalInfo();
        createPipe("create pipe p_inspect as insert into tbl " +
                "select * from files('path'='fake://pipe', 'format'='parquet')");

        String sql = "select inspect_all_pipes()";
        String plan = UtFrameUtils.getFragmentPlan(newCtx, sql);
        Assert.assertTrue(plan.contains("name"));
    }