public void execute() throws Exception {
        forward();
        LOG.info("forwarding to master get result max journal id: {}", result.maxJournalId);
        ctx.getGlobalStateMgr().getJournalObservable().waitOn(result.maxJournalId, waitTimeoutMs);

        if (result.state != null) {
            MysqlStateType state = MysqlStateType.fromString(result.state);
            if (state != null) {
                ctx.getState().setStateType(state);
                if (result.isSetErrorMsg()) {
                    ctx.getState().setMsg(result.getErrorMsg());
                }
                if (state == MysqlStateType.EOF || state == MysqlStateType.OK) {
                    afterForward();
                }
            }
        }

        if (result.isSetResource_group_name()) {
            ctx.getAuditEventBuilder().setResourceGroup(result.getResource_group_name());
        }
        if (result.isSetAudit_statistics()) {
            TAuditStatistics tAuditStatistics = result.getAudit_statistics();
            if (ctx.getExecutor() != null) {
                ctx.getExecutor().setQueryStatistics(AuditStatisticsUtil.toProtobuf(tAuditStatistics));
            }
        }
    }
@Test
    public void testResourceGroupNameInAuditLog() throws Exception {

        String createGroup = "create resource group rg1\n" +
                "to\n" +
                "    (db='d1')\n" +
                "with (\n" +
                "    'cpu_core_limit' = '1',\n" +
                "    'mem_limit' = '50%',\n" +
                "    'concurrency_limit' = '20',\n" +
                "    'type' = 'normal'\n" +
                ");";
        cluster.runSql("d1", createGroup);

        String sql = "insert into t1 select * from t1";
        StatementBase stmtBase = UtFrameUtils.parseStmtWithNewParser(sql, connectContext);
        LeaderOpExecutor executor =
                new LeaderOpExecutor(stmtBase, stmtBase.getOrigStmt(), connectContext, RedirectStatus.FORWARD_NO_SYNC);

        mockFrontendService(new MockFrontendServiceClient());
        executor.execute();

        Assert.assertEquals("rg1", connectContext.getAuditEventBuilder().build().resourceGroup);
    }