2121import org .apache .doris .catalog .TableIf .TableType ;
2222import org .apache .doris .nereids .trees .TreeNode ;
2323import org .apache .doris .nereids .trees .expressions .Expression ;
24- import org .apache .doris .nereids .trees .expressions .functions .scalar .CurrentDate ;
25- import org .apache .doris .nereids .trees .expressions .functions .scalar .Now ;
24+ import org .apache .doris .nereids .trees .expressions .functions .scalar .Random ;
25+ import org .apache .doris .nereids .trees .expressions .functions .scalar .Uuid ;
2626import org .apache .doris .nereids .trees .plans .physical .PhysicalPlan ;
2727import org .apache .doris .nereids .trees .plans .visitor .NondeterministicFunctionCollector ;
2828import org .apache .doris .nereids .trees .plans .visitor .TableCollector ;
@@ -76,15 +76,15 @@ protected void runBeforeAll() throws Exception {
7676 + "\" replication_num\" = \" 1\" \n "
7777 + ");" );
7878
79- createView ("CREATE VIEW `view1` AS SELECT t1.*, current_date () FROM\n "
79+ createView ("CREATE VIEW `view1` AS SELECT t1.*, random () FROM\n "
8080 + "`table1` t1 LEFT JOIN\n "
8181 + "`table2` t2 ON t1.c1 = t2.c1;" );
8282 }
8383
8484 @ Test
8585 public void test1 () {
8686 PlanChecker .from (connectContext )
87- .checkPlannerResult ("SELECT *, now () FROM table1 "
87+ .checkPlannerResult ("SELECT *, random () FROM table1 "
8888 + "LEFT SEMI JOIN table2 ON table1.c1 = table2.c1 "
8989 + "WHERE table1.c1 IN (SELECT c1 FROM table2) OR table1.c1 < 10" ,
9090 nereidsPlanner -> {
@@ -93,7 +93,7 @@ public void test1() {
9393 // Check nondeterministic collect
9494 physicalPlan .accept (NondeterministicFunctionCollector .INSTANCE , collectResult );
9595 Assertions .assertEquals (1 , collectResult .size ());
96- Assertions .assertTrue (collectResult .get (0 ) instanceof Now );
96+ Assertions .assertTrue (collectResult .get (0 ) instanceof Random );
9797 // Check get tables
9898 TableCollectorContext collectorContext =
9999 new TableCollector .TableCollectorContext (Sets .newHashSet (TableType .OLAP ));
@@ -114,7 +114,7 @@ public void test1() {
114114 @ Test
115115 public void test2 () {
116116 PlanChecker .from (connectContext )
117- .checkPlannerResult ("SELECT view1.*, now () FROM view1 "
117+ .checkPlannerResult ("SELECT view1.*, uuid () FROM view1 "
118118 + "LEFT SEMI JOIN table2 ON view1.c1 = table2.c1 "
119119 + "WHERE view1.c1 IN (SELECT c1 FROM table2) OR view1.c1 < 10" ,
120120 nereidsPlanner -> {
@@ -123,8 +123,8 @@ public void test2() {
123123 // Check nondeterministic collect
124124 physicalPlan .accept (NondeterministicFunctionCollector .INSTANCE , collectResult );
125125 Assertions .assertEquals (2 , collectResult .size ());
126- Assertions .assertTrue (collectResult .get (0 ) instanceof Now );
127- Assertions .assertTrue (collectResult .get (1 ) instanceof CurrentDate );
126+ Assertions .assertTrue (collectResult .get (0 ) instanceof Uuid );
127+ Assertions .assertTrue (collectResult .get (1 ) instanceof Random );
128128 // Check get tables
129129 TableCollectorContext collectorContext =
130130 new TableCollector .TableCollectorContext (Sets .newHashSet (TableType .OLAP ));
0 commit comments