boolean hasNonDeterministicFunctions(Expr expr) {
        if (expr instanceof FunctionCallExpr) {
            FunctionCallExpr callExpr = (FunctionCallExpr) expr;
            String funcName = callExpr.getFn().functionName();
            if (FunctionSet.nonDeterministicFunctions.contains(funcName)) {
                return true;
            }
            if (FunctionSet.NOW.equals(funcName)) {
                return true;
            }
            if (FunctionSet.nonDeterministicTimeFunctions.contains(funcName) && callExpr.getChildren().isEmpty()) {
                return true;
            }
        }
        return expr.getChildren().stream().anyMatch(this::hasNonDeterministicFunctions);
    }
@Test
    public void testNondetermisticTimeFunction() {
        FragmentNormalizer fragmentNormalizer = new FragmentNormalizer(null, null);
        ConnectContext ctx = UtFrameUtils.createDefaultCtx();
        for (String funcName : FunctionSet.nonDeterministicTimeFunctions) {
            String sql = String.format("select %s()", funcName);
            StatementBase statementBase;
            try {
                statementBase = com.starrocks.sql.parser.SqlParser.parse(sql, ctx.getSessionVariable()).get(0);
                com.starrocks.sql.analyzer.Analyzer.analyze(statementBase, ctx);
            } catch (Throwable ignored) {
                continue;
            }
            QueryStatement queryStatement = (QueryStatement) statementBase;
            SelectRelation selectRelation = (SelectRelation) queryStatement.getQueryRelation();
            Expr expr = selectRelation.getSelectList().getItems().get(0).getExpr();
            Assert.assertTrue(expr instanceof FunctionCallExpr);
            Assert.assertTrue(fragmentNormalizer.hasNonDeterministicFunctions(expr));
        }

        for (String funcName : FunctionSet.nonDeterministicTimeFunctions) {
            String sql = String.format("select %s('2022-12-01')", funcName);
            StatementBase statementBase;
            try {
                statementBase = com.starrocks.sql.parser.SqlParser.parse(sql, ctx.getSessionVariable()).get(0);
                com.starrocks.sql.analyzer.Analyzer.analyze(statementBase, ctx);
            } catch (Throwable ignored) {
                continue;
            }
            QueryStatement queryStatement = (QueryStatement) statementBase;
            SelectRelation selectRelation = (SelectRelation) queryStatement.getQueryRelation();
            Expr expr = selectRelation.getSelectList().getItems().get(0).getExpr();
            Assert.assertTrue(expr instanceof FunctionCallExpr);
            if (funcName.equals(FunctionSet.NOW)) {
                Assert.assertTrue(fragmentNormalizer.hasNonDeterministicFunctions(expr));
            } else {
                Assert.assertFalse(fragmentNormalizer.hasNonDeterministicFunctions(expr));
            }
        }
    }