Skip to content

Conversation

@seawinde
Copy link
Contributor

@seawinde seawinde commented Jun 11, 2024

Proposed changes

Support to use current_date() when create async materialized view by adding
'enable_nondeterministic_function' = 'true' in properties when create materialized view. enable_nondeterministic_function is default false.

Here is a example, it will success

   CREATE MATERIALIZED VIEW mv_name
   BUILD DEFERRED REFRESH AUTO ON MANUAL
   DISTRIBUTED BY RANDOM BUCKETS 2
   PROPERTIES (
   'replication_num' = '1',
   'enable_nondeterministic_function' = 'true'
   )
   AS
   SELECT *, unix_timestamp(k3, '%Y-%m-%d %H:%i-%s') from ${tableName} where current_date() > k3;

Note:
unix_timestamp is nondeterministic when has no params. it is deterministic when has params which means format column k3 date

another example, it will success

   CREATE MATERIALIZED VIEW mv_name
   BUILD DEFERRED REFRESH AUTO ON MANUAL
   DISTRIBUTED BY RANDOM BUCKETS 2
   PROPERTIES (
   'replication_num' = '1',
   'enable_nondeterministic_function' = 'true'
   )
   AS
   SELECT *, unix_timestamp() from ${tableName} where current_date() > k3;

though unix_timestamp() is nondeterministic, we add 'enable_date_nondeterministic_function' = 'true' in properties

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@seawinde
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 39959 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 46b8c2ae4ecb8280d51b1973802d33ec30e7ba43, data reload: false

------ Round 1 ----------------------------------
q1	18064	4632	4382	4382
q2	2578	195	195	195
q3	11072	1090	1195	1090
q4	10735	798	830	798
q5	7522	2694	2739	2694
q6	226	144	144	144
q7	960	624	618	618
q8	9281	2090	2110	2090
q9	8841	6459	6425	6425
q10	8937	3674	3684	3674
q11	488	233	243	233
q12	436	228	225	225
q13	17784	3039	3004	3004
q14	268	226	220	220
q15	519	483	473	473
q16	509	376	374	374
q17	952	692	656	656
q18	8058	7421	7360	7360
q19	3623	1511	1443	1443
q20	651	303	323	303
q21	4942	3950	3233	3233
q22	390	325	328	325
Total cold run time: 116836 ms
Total hot run time: 39959 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4382	4205	4201	4201
q2	378	257	270	257
q3	2927	2709	2800	2709
q4	1913	1625	1606	1606
q5	5262	5305	5299	5299
q6	215	127	128	127
q7	2154	1721	1697	1697
q8	3204	3333	3309	3309
q9	8358	8289	8285	8285
q10	3903	3673	3663	3663
q11	577	489	498	489
q12	798	588	606	588
q13	17401	3032	2996	2996
q14	292	273	266	266
q15	529	495	487	487
q16	470	431	408	408
q17	1772	1489	1461	1461
q18	7594	7678	7461	7461
q19	4957	1587	1548	1548
q20	2005	1779	1764	1764
q21	4811	4637	4868	4637
q22	596	529	533	529
Total cold run time: 74498 ms
Total hot run time: 53787 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 169159 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 46b8c2ae4ecb8280d51b1973802d33ec30e7ba43, data reload: false

query1	924	382	376	376
query2	6442	2376	2269	2269
query3	6649	205	205	205
query4	19054	17468	17326	17326
query5	4146	465	461	461
query6	271	156	163	156
query7	4586	298	292	292
query8	310	281	279	279
query9	8406	2409	2389	2389
query10	615	296	289	289
query11	10605	10129	10020	10020
query12	139	86	92	86
query13	1635	366	375	366
query14	10146	6870	7694	6870
query15	234	183	184	183
query16	7881	267	259	259
query17	1913	534	545	534
query18	1942	269	267	267
query19	212	165	154	154
query20	91	82	87	82
query21	213	127	125	125
query22	4311	4093	3950	3950
query23	33637	33063	32901	32901
query24	11109	2856	2815	2815
query25	637	359	367	359
query26	1594	153	149	149
query27	2971	316	314	314
query28	7543	2055	2049	2049
query29	1001	626	602	602
query30	269	150	150	150
query31	933	744	732	732
query32	91	57	55	55
query33	770	283	275	275
query34	960	462	456	456
query35	775	627	603	603
query36	1073	929	915	915
query37	161	72	70	70
query38	2898	2721	2737	2721
query39	824	785	800	785
query40	285	125	123	123
query41	54	54	53	53
query42	123	101	97	97
query43	572	552	528	528
query44	1231	724	738	724
query45	198	169	166	166
query46	1072	717	716	716
query47	1841	1768	1771	1768
query48	390	300	300	300
query49	1173	409	403	403
query50	756	379	375	375
query51	6790	6772	6649	6649
query52	111	90	95	90
query53	356	291	289	289
query54	1074	442	490	442
query55	75	73	74	73
query56	277	257	259	257
query57	1135	1042	1078	1042
query58	267	235	254	235
query59	3437	3260	3141	3141
query60	294	273	268	268
query61	90	88	89	88
query62	652	450	448	448
query63	320	287	286	286
query64	9928	2276	1696	1696
query65	3206	3117	3115	3115
query66	1371	339	328	328
query67	15236	14919	14933	14919
query68	4554	543	530	530
query69	457	297	303	297
query70	1051	1154	1152	1152
query71	393	275	271	271
query72	7037	2748	2558	2558
query73	727	323	328	323
query74	5986	5505	5479	5479
query75	3404	2644	2675	2644
query76	2669	903	959	903
query77	430	303	299	299
query78	10284	9952	9587	9587
query79	2348	514	515	514
query80	1143	455	458	455
query81	584	222	215	215
query82	745	102	101	101
query83	241	167	169	167
query84	244	88	81	81
query85	1999	300	265	265
query86	489	313	314	313
query87	3349	3108	3109	3108
query88	4320	2403	2366	2366
query89	482	382	390	382
query90	1820	198	194	194
query91	132	176	98	98
query92	68	50	51	50
query93	2158	502	499	499
query94	1235	185	180	180
query95	405	313	304	304
query96	583	275	269	269
query97	3161	3019	3019	3019
query98	229	205	189	189
query99	1249	839	850	839
Total cold run time: 274261 ms
Total hot run time: 169159 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 30.71 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 46b8c2ae4ecb8280d51b1973802d33ec30e7ba43, data reload: false

query1	0.04	0.04	0.04
query2	0.07	0.04	0.04
query3	0.23	0.06	0.05
query4	1.68	0.07	0.07
query5	0.52	0.49	0.50
query6	1.13	0.72	0.73
query7	0.02	0.02	0.02
query8	0.06	0.05	0.04
query9	0.53	0.48	0.48
query10	0.54	0.55	0.53
query11	0.15	0.11	0.11
query12	0.14	0.11	0.11
query13	0.59	0.58	0.61
query14	0.78	0.78	0.78
query15	0.81	0.83	0.80
query16	0.37	0.37	0.36
query17	1.01	1.00	1.03
query18	0.21	0.24	0.28
query19	1.88	1.72	1.82
query20	0.01	0.01	0.02
query21	15.41	0.65	0.64
query22	4.11	7.63	1.95
query23	18.27	1.44	1.31
query24	2.10	0.23	0.21
query25	0.15	0.10	0.09
query26	0.26	0.18	0.18
query27	0.08	0.08	0.09
query28	13.26	1.01	1.00
query29	12.62	3.33	3.32
query30	0.26	0.07	0.07
query31	2.85	0.38	0.39
query32	3.28	0.48	0.47
query33	2.94	2.85	2.90
query34	17.00	4.43	4.45
query35	4.49	4.50	4.48
query36	0.63	0.46	0.47
query37	0.18	0.15	0.16
query38	0.15	0.15	0.15
query39	0.04	0.04	0.03
query40	0.18	0.15	0.14
query41	0.11	0.05	0.05
query42	0.06	0.04	0.05
query43	0.04	0.04	0.04
Total cold run time: 109.24 s
Total hot run time: 30.71 s

@seawinde
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 40702 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 60055d707307ec17e7bba99ef67ba75b5cf36bbc, data reload: false

------ Round 1 ----------------------------------
q1	17629	4318	4316	4316
q2	2036	200	194	194
q3	10449	1178	1131	1131
q4	10190	848	788	788
q5	7465	2720	2562	2562
q6	225	145	142	142
q7	951	621	608	608
q8	9227	2054	2076	2054
q9	8891	6439	6455	6439
q10	8972	3758	3804	3758
q11	492	241	249	241
q12	492	243	229	229
q13	17770	2988	2964	2964
q14	272	223	219	219
q15	537	476	490	476
q16	516	394	379	379
q17	977	719	700	700
q18	8096	7579	7441	7441
q19	7120	1467	1533	1467
q20	655	315	316	315
q21	4981	3938	3995	3938
q22	407	341	344	341
Total cold run time: 118350 ms
Total hot run time: 40702 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4523	4301	4332	4301
q2	371	263	256	256
q3	3212	2923	2998	2923
q4	2008	1782	1752	1752
q5	5481	5501	5549	5501
q6	231	134	149	134
q7	2233	1842	1868	1842
q8	3282	3423	3406	3406
q9	8651	8805	8685	8685
q10	4210	3795	3854	3795
q11	580	498	495	495
q12	814	639	623	623
q13	17275	3165	3232	3165
q14	329	273	286	273
q15	554	472	481	472
q16	502	427	430	427
q17	1818	1520	1519	1519
q18	8148	8021	7798	7798
q19	1818	1541	1589	1541
q20	2151	1888	1834	1834
q21	5047	4896	4788	4788
q22	706	589	585	585
Total cold run time: 73944 ms
Total hot run time: 56115 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 173055 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 60055d707307ec17e7bba99ef67ba75b5cf36bbc, data reload: false

query1	905	372	369	369
query2	6449	2355	2333	2333
query3	6639	207	212	207
query4	23105	17321	17299	17299
query5	3710	454	470	454
query6	242	160	152	152
query7	4573	287	296	287
query8	319	314	288	288
query9	8604	2331	2323	2323
query10	557	303	283	283
query11	10512	9990	10055	9990
query12	121	81	83	81
query13	1630	371	359	359
query14	9437	6771	7565	6771
query15	243	186	196	186
query16	7736	261	266	261
query17	1896	525	504	504
query18	1926	260	268	260
query19	191	156	145	145
query20	86	80	98	80
query21	205	130	122	122
query22	4456	4100	4059	4059
query23	33931	33437	33480	33437
query24	11111	2900	2975	2900
query25	614	377	369	369
query26	1447	150	150	150
query27	2969	319	322	319
query28	7800	2093	2064	2064
query29	909	644	662	644
query30	256	157	155	155
query31	991	753	747	747
query32	86	53	59	53
query33	764	283	286	283
query34	1079	473	497	473
query35	719	641	624	624
query36	1169	960	989	960
query37	164	80	70	70
query38	2907	2835	2875	2835
query39	903	852	816	816
query40	216	124	125	124
query41	55	51	52	51
query42	109	97	108	97
query43	588	535	532	532
query44	1234	745	740	740
query45	188	160	163	160
query46	1088	703	714	703
query47	1852	1749	1785	1749
query48	375	303	289	289
query49	843	411	402	402
query50	763	385	384	384
query51	6778	6585	6678	6585
query52	97	99	87	87
query53	355	278	276	276
query54	865	453	438	438
query55	77	74	75	74
query56	269	252	248	248
query57	1127	1061	1030	1030
query58	254	236	242	236
query59	3321	3223	3208	3208
query60	283	263	276	263
query61	108	102	103	102
query62	648	452	441	441
query63	314	285	287	285
query64	8838	2305	1878	1878
query65	3189	3093	3053	3053
query66	842	311	327	311
query67	15486	15063	15084	15063
query68	4518	536	541	536
query69	632	489	408	408
query70	1200	1139	1149	1139
query71	409	272	266	266
query72	7510	5382	5586	5382
query73	743	321	320	320
query74	5883	5437	5520	5437
query75	3402	2604	2629	2604
query76	2696	919	870	870
query77	609	338	298	298
query78	10414	9951	9668	9668
query79	2486	516	522	516
query80	2273	464	449	449
query81	559	221	222	221
query82	770	105	102	102
query83	281	166	167	166
query84	274	94	85	85
query85	1382	278	258	258
query86	464	308	305	305
query87	3227	3079	3122	3079
query88	3791	2423	2427	2423
query89	462	373	376	373
query90	1737	184	179	179
query91	130	97	99	97
query92	62	48	48	48
query93	2406	559	498	498
query94	1110	182	186	182
query95	401	311	309	309
query96	582	272	265	265
query97	3192	3040	3062	3040
query98	240	200	200	200
query99	1210	824	811	811
Total cold run time: 276578 ms
Total hot run time: 173055 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 30.72 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 60055d707307ec17e7bba99ef67ba75b5cf36bbc, data reload: false

query1	0.04	0.03	0.03
query2	0.07	0.04	0.04
query3	0.22	0.05	0.05
query4	1.68	0.07	0.07
query5	0.50	0.48	0.48
query6	1.13	0.74	0.73
query7	0.02	0.02	0.02
query8	0.04	0.04	0.05
query9	0.55	0.48	0.48
query10	0.54	0.56	0.54
query11	0.15	0.11	0.11
query12	0.15	0.12	0.12
query13	0.59	0.58	0.61
query14	0.79	0.76	0.79
query15	0.83	0.80	0.81
query16	0.36	0.36	0.37
query17	1.02	1.03	1.01
query18	0.22	0.24	0.26
query19	1.78	1.67	1.71
query20	0.01	0.01	0.01
query21	15.42	0.68	0.64
query22	3.90	7.63	2.15
query23	18.25	1.51	1.34
query24	2.10	0.23	0.22
query25	0.16	0.09	0.08
query26	0.26	0.18	0.17
query27	0.08	0.07	0.08
query28	13.25	1.00	1.01
query29	12.64	3.37	3.31
query30	0.25	0.06	0.06
query31	2.86	0.39	0.38
query32	3.27	0.47	0.46
query33	2.84	2.90	2.84
query34	17.09	4.38	4.41
query35	4.55	4.43	4.47
query36	0.66	0.46	0.46
query37	0.18	0.15	0.14
query38	0.15	0.14	0.14
query39	0.04	0.04	0.04
query40	0.17	0.14	0.14
query41	0.10	0.05	0.05
query42	0.06	0.05	0.05
query43	0.04	0.03	0.04
Total cold run time: 109.01 s
Total hot run time: 30.72 s

@morrySnow
Copy link
Contributor

support all nondeterministic function ?

@seawinde
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 39864 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 0a51ed6f4674fc97866c51069e64e904d5295982, data reload: false

------ Round 1 ----------------------------------
q1	17768	4461	4437	4437
q2	2954	189	193	189
q3	11972	1123	1229	1123
q4	10910	782	811	782
q5	7493	2714	2639	2639
q6	222	135	135	135
q7	958	618	594	594
q8	9233	2066	2029	2029
q9	8784	6450	6453	6450
q10	8915	3697	3711	3697
q11	472	239	236	236
q12	404	233	217	217
q13	17772	2940	2940	2940
q14	268	212	219	212
q15	535	484	465	465
q16	520	371	367	367
q17	947	675	646	646
q18	8003	7408	7378	7378
q19	6662	1551	1442	1442
q20	654	310	320	310
q21	4887	3261	3253	3253
q22	383	330	323	323
Total cold run time: 120716 ms
Total hot run time: 39864 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4377	4213	4218	4213
q2	369	260	268	260
q3	2986	2745	2718	2718
q4	1867	1529	1604	1529
q5	5228	5238	5214	5214
q6	217	128	126	126
q7	2095	1738	1748	1738
q8	3195	3301	3276	3276
q9	8281	8277	8286	8277
q10	3859	3682	3640	3640
q11	577	480	493	480
q12	753	576	613	576
q13	16463	3006	2968	2968
q14	293	255	251	251
q15	512	469	464	464
q16	489	403	414	403
q17	1783	1460	1467	1460
q18	7530	7485	7239	7239
q19	1697	1472	1530	1472
q20	1979	1767	1774	1767
q21	4855	4740	4667	4667
q22	595	514	542	514
Total cold run time: 70000 ms
Total hot run time: 53252 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 170309 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 0a51ed6f4674fc97866c51069e64e904d5295982, data reload: false

query1	937	388	371	371
query2	6452	2435	2418	2418
query3	6646	212	213	212
query4	20168	17486	17349	17349
query5	4134	465	448	448
query6	258	162	164	162
query7	4598	295	292	292
query8	322	284	303	284
query9	8557	2358	2354	2354
query10	598	304	285	285
query11	10681	10170	10085	10085
query12	134	87	83	83
query13	1649	375	358	358
query14	9433	7432	7482	7432
query15	237	188	195	188
query16	7982	270	255	255
query17	2094	558	520	520
query18	1976	269	267	267
query19	192	169	156	156
query20	91	82	79	79
query21	210	132	123	123
query22	4396	4105	3993	3993
query23	33845	33091	33024	33024
query24	11980	2866	2840	2840
query25	677	380	349	349
query26	1801	150	151	150
query27	3007	310	321	310
query28	7297	2025	2025	2025
query29	1106	627	613	613
query30	287	154	149	149
query31	945	749	751	749
query32	91	56	56	56
query33	756	286	284	284
query34	964	477	459	459
query35	732	592	624	592
query36	1116	962	981	962
query37	213	74	71	71
query38	2884	2740	2737	2737
query39	847	797	797	797
query40	289	124	124	124
query41	55	52	49	49
query42	115	97	99	97
query43	605	562	557	557
query44	1184	734	739	734
query45	196	167	164	164
query46	1103	696	734	696
query47	1896	1743	1780	1743
query48	392	303	298	298
query49	1211	398	398	398
query50	766	379	387	379
query51	6723	6645	6589	6589
query52	108	86	97	86
query53	371	279	285	279
query54	979	440	443	440
query55	75	78	74	74
query56	285	256	264	256
query57	1152	1039	1064	1039
query58	255	250	247	247
query59	3590	3097	3172	3097
query60	297	273	274	273
query61	93	92	94	92
query62	641	440	445	440
query63	315	287	283	283
query64	9827	2225	1761	1761
query65	3162	3148	3099	3099
query66	1393	332	338	332
query67	15418	14807	14935	14807
query68	4569	545	558	545
query69	443	306	302	302
query70	1100	1115	1096	1096
query71	394	275	265	265
query72	6988	5109	2755	2755
query73	752	326	323	323
query74	6025	5557	5491	5491
query75	3448	2683	2604	2604
query76	2719	923	873	873
query77	435	292	285	285
query78	10311	9791	9812	9791
query79	2621	506	515	506
query80	1247	466	455	455
query81	573	217	220	217
query82	757	107	104	104
query83	238	173	183	173
query84	237	84	90	84
query85	1671	288	267	267
query86	494	312	307	307
query87	3307	3117	3085	3085
query88	4263	2433	2438	2433
query89	458	372	378	372
query90	1773	193	189	189
query91	126	99	100	99
query92	58	47	51	47
query93	1917	510	503	503
query94	1214	191	185	185
query95	404	305	334	305
query96	589	273	271	271
query97	3251	3045	3067	3045
query98	247	198	197	197
query99	1204	859	821	821
Total cold run time: 276622 ms
Total hot run time: 170309 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 30.39 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 0a51ed6f4674fc97866c51069e64e904d5295982, data reload: false

query1	0.04	0.04	0.03
query2	0.09	0.04	0.04
query3	0.23	0.06	0.05
query4	1.69	0.10	0.08
query5	0.51	0.50	0.49
query6	1.14	0.72	0.72
query7	0.02	0.01	0.01
query8	0.06	0.04	0.05
query9	0.54	0.50	0.49
query10	0.55	0.55	0.53
query11	0.16	0.11	0.11
query12	0.14	0.11	0.11
query13	0.59	0.58	0.61
query14	0.78	0.79	0.77
query15	0.83	0.83	0.82
query16	0.37	0.37	0.37
query17	0.96	1.02	0.96
query18	0.22	0.26	0.23
query19	1.95	1.76	1.84
query20	0.02	0.01	0.02
query21	15.41	0.66	0.64
query22	4.46	7.69	1.79
query23	18.29	1.39	1.33
query24	2.09	0.22	0.23
query25	0.16	0.07	0.09
query26	0.26	0.17	0.17
query27	0.08	0.09	0.07
query28	13.24	1.01	1.00
query29	12.60	3.25	3.20
query30	0.26	0.06	0.06
query31	2.84	0.38	0.38
query32	3.29	0.46	0.46
query33	2.90	2.88	2.94
query34	17.06	4.40	4.42
query35	4.51	4.50	4.47
query36	0.66	0.48	0.48
query37	0.18	0.14	0.15
query38	0.15	0.14	0.15
query39	0.05	0.04	0.03
query40	0.18	0.15	0.14
query41	0.09	0.04	0.05
query42	0.06	0.04	0.04
query43	0.04	0.04	0.04
Total cold run time: 109.75 s
Total hot run time: 30.39 s

* Identify the function is deterministic or not, such as UnixTimestamp, when it's children is not empty
* it's deterministic
*/
boolean isDeterministic();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add this interface to expression with default implement check all check isDeterministic. Nondeterministic default return false. unixTimestamp do not implement Nondeterministic anymore. all check isntance of Nondeterministic change to check expression.isDeterministic().

* the expression in whiteFunctionSet would not be collected
*/
public static class FunctionCollectContext {
private final List<Expression> collectedExpressions = new LinkedList<>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not use java's linkedList in any case. it has poor perf with no adv with ArrayList

return collectedExpressions;
}
expressions.forEach(expression -> {
collectedExpressions.addAll(expression.collect(Nondeterministic.class::isInstance));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think u could collected isDeterministic == true after move this interface into expression

@seawinde
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 39478 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 09a21b0bf59af6690956d24b66df3b1198feb7d0, data reload: false

------ Round 1 ----------------------------------
q1	17619	4292	4254	4254
q2	2031	193	203	193
q3	10434	1159	1050	1050
q4	10188	745	755	745
q5	7464	2627	2610	2610
q6	218	134	131	131
q7	950	598	592	592
q8	9230	2065	2025	2025
q9	8693	6428	6426	6426
q10	8957	3681	3724	3681
q11	450	237	244	237
q12	471	226	223	223
q13	18580	2957	2984	2957
q14	258	208	220	208
q15	510	477	470	470
q16	511	367	369	367
q17	955	727	716	716
q18	7979	7391	7430	7391
q19	5186	1512	1464	1464
q20	645	303	311	303
q21	4980	3099	3916	3099
q22	389	345	336	336
Total cold run time: 116698 ms
Total hot run time: 39478 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4352	4312	4276	4276
q2	377	271	282	271
q3	2977	2830	2925	2830
q4	2000	1718	1682	1682
q5	5637	5518	5487	5487
q6	226	128	128	128
q7	2203	1900	1899	1899
q8	3276	3426	3428	3426
q9	8733	8670	8865	8670
q10	4064	3948	3727	3727
q11	619	494	495	494
q12	828	648	643	643
q13	16040	3417	3426	3417
q14	339	288	317	288
q15	544	496	488	488
q16	520	451	448	448
q17	1824	1528	1512	1512
q18	8526	8251	8231	8231
q19	2265	1667	1629	1629
q20	2068	1911	1880	1880
q21	10177	4905	4963	4905
q22	655	567	565	565
Total cold run time: 78250 ms
Total hot run time: 56896 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 174267 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 09a21b0bf59af6690956d24b66df3b1198feb7d0, data reload: false

query1	939	376	380	376
query2	6452	2427	2259	2259
query3	6635	210	211	210
query4	18779	17251	17149	17149
query5	3557	484	456	456
query6	238	167	159	159
query7	4580	306	297	297
query8	308	298	294	294
query9	8501	2355	2326	2326
query10	558	315	296	296
query11	10458	10086	9988	9988
query12	119	92	83	83
query13	1629	371	366	366
query14	9603	7179	7631	7179
query15	227	191	183	183
query16	7710	265	259	259
query17	1922	541	543	541
query18	1777	276	280	276
query19	199	152	154	152
query20	92	79	83	79
query21	208	125	126	125
query22	4404	3937	3956	3937
query23	33701	33669	33743	33669
query24	11160	2926	2875	2875
query25	595	365	392	365
query26	850	160	158	158
query27	2327	324	343	324
query28	6590	2111	2097	2097
query29	882	627	629	627
query30	251	149	156	149
query31	994	776	731	731
query32	106	66	59	59
query33	812	307	325	307
query34	967	503	490	490
query35	770	654	653	653
query36	1132	1010	987	987
query37	151	80	74	74
query38	2921	2822	2812	2812
query39	887	842	846	842
query40	220	135	139	135
query41	57	56	58	56
query42	116	107	107	107
query43	622	572	547	547
query44	1220	743	774	743
query45	193	160	165	160
query46	1086	752	740	740
query47	1851	1774	1749	1749
query48	379	316	310	310
query49	860	420	421	420
query50	789	399	403	399
query51	6823	6738	6631	6631
query52	110	96	101	96
query53	361	299	293	293
query54	888	461	466	461
query55	77	79	77	77
query56	298	278	285	278
query57	1154	1037	1038	1037
query58	245	245	254	245
query59	3462	3168	3115	3115
query60	309	294	290	290
query61	113	108	110	108
query62	610	453	447	447
query63	320	302	292	292
query64	8969	2256	1772	1772
query65	3333	3107	3073	3073
query66	833	327	322	322
query67	15503	15053	15248	15053
query68	6226	553	550	550
query69	673	422	424	422
query70	1157	1077	1145	1077
query71	515	276	270	270
query72	8516	5789	5517	5517
query73	826	327	330	327
query74	5821	5499	5480	5480
query75	4464	2683	2690	2683
query76	4090	997	936	936
query77	737	311	289	289
query78	10510	9822	9830	9822
query79	3787	514	511	511
query80	1191	461	507	461
query81	585	225	219	219
query82	784	107	99	99
query83	275	171	168	168
query84	268	89	87	87
query85	1298	287	270	270
query86	454	336	345	336
query87	3242	3077	3077	3077
query88	4617	2467	2436	2436
query89	484	378	384	378
query90	1793	191	185	185
query91	132	99	98	98
query92	57	50	55	50
query93	5021	509	508	508
query94	1080	197	193	193
query95	404	318	316	316
query96	611	271	273	271
query97	3237	3053	3041	3041
query98	214	199	199	199
query99	1193	843	826	826
Total cold run time: 279054 ms
Total hot run time: 174267 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 30.69 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 09a21b0bf59af6690956d24b66df3b1198feb7d0, data reload: false

query1	0.04	0.03	0.03
query2	0.08	0.03	0.04
query3	0.23	0.05	0.05
query4	1.67	0.07	0.07
query5	0.51	0.48	0.49
query6	1.13	0.71	0.72
query7	0.02	0.02	0.01
query8	0.04	0.04	0.04
query9	0.55	0.50	0.50
query10	0.54	0.55	0.55
query11	0.16	0.12	0.12
query12	0.16	0.12	0.12
query13	0.59	0.61	0.58
query14	0.79	0.77	0.80
query15	0.81	0.82	0.81
query16	0.36	0.36	0.36
query17	0.97	0.95	0.97
query18	0.20	0.28	0.22
query19	1.79	1.71	1.71
query20	0.02	0.01	0.01
query21	15.41	0.66	0.66
query22	4.34	7.20	2.19
query23	18.27	1.29	1.20
query24	2.21	0.21	0.21
query25	0.15	0.07	0.08
query26	0.27	0.18	0.17
query27	0.08	0.08	0.07
query28	13.20	1.02	0.99
query29	12.60	3.37	3.40
query30	0.26	0.06	0.06
query31	2.86	0.39	0.37
query32	3.29	0.46	0.46
query33	2.88	2.93	2.87
query34	17.00	4.39	4.49
query35	4.48	4.53	4.44
query36	0.65	0.47	0.45
query37	0.18	0.16	0.15
query38	0.14	0.15	0.15
query39	0.04	0.04	0.04
query40	0.17	0.15	0.14
query41	0.09	0.04	0.04
query42	0.05	0.05	0.04
query43	0.04	0.04	0.04
Total cold run time: 109.32 s
Total hot run time: 30.69 s

* Identify the expression is deterministic or not
*/
default boolean isDeterministic() {
return true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recursive call children's isDeterministic

@seawinde
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 40459 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit a98b900902dd69816757a37f276d8bfbe8b9f679, data reload: false

------ Round 1 ----------------------------------
q1	17617	4374	4274	4274
q2	2035	190	196	190
q3	10447	1136	1155	1136
q4	10192	791	788	788
q5	7469	2625	2664	2625
q6	221	137	136	136
q7	957	613	594	594
q8	9237	2061	2068	2061
q9	8747	6512	6469	6469
q10	8953	3717	3770	3717
q11	457	240	239	239
q12	448	236	228	228
q13	17767	2992	2968	2968
q14	268	214	223	214
q15	538	474	474	474
q16	504	372	373	372
q17	960	828	609	609
q18	7961	7385	7335	7335
q19	7917	1419	1418	1418
q20	653	319	328	319
q21	4882	3976	3946	3946
q22	391	350	347	347
Total cold run time: 118621 ms
Total hot run time: 40459 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4404	4390	4214	4214
q2	372	262	263	262
q3	3060	2858	2943	2858
q4	1991	1744	1730	1730
q5	5473	5530	5398	5398
q6	223	129	139	129
q7	2272	1860	1893	1860
q8	3296	3436	3387	3387
q9	8701	8854	8739	8739
q10	4195	3724	3765	3724
q11	586	502	493	493
q12	817	635	646	635
q13	16159	3181	3141	3141
q14	299	268	272	268
q15	525	469	491	469
q16	494	435	447	435
q17	1784	1523	1524	1523
q18	8015	7915	7882	7882
q19	1781	1722	1589	1589
q20	3040	1918	1860	1860
q21	5059	4976	4807	4807
q22	633	530	564	530
Total cold run time: 73179 ms
Total hot run time: 55933 ms

boolean containsNondeterministic = !((ExpressionTrait) expr).isDeterministic();
if (!collectContext.getCollectExpressionTypes().isEmpty()) {
containsNondeterministic &= collectContext.getCollectExpressionTypes().stream()
.anyMatch(type -> type.isAssignableFrom(expr.getClass()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why need type.isAssignableFrom(expr.getClass())

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have removed this

@doris-robot
Copy link

ClickBench: Total hot run time: 30.18 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit a98b900902dd69816757a37f276d8bfbe8b9f679, data reload: false

query1	0.05	0.03	0.03
query2	0.07	0.04	0.04
query3	0.23	0.06	0.05
query4	1.68	0.08	0.08
query5	0.49	0.48	0.50
query6	1.13	0.73	0.72
query7	0.02	0.01	0.02
query8	0.05	0.04	0.04
query9	0.55	0.50	0.50
query10	0.55	0.54	0.55
query11	0.16	0.12	0.12
query12	0.14	0.11	0.13
query13	0.60	0.59	0.61
query14	0.76	0.80	0.77
query15	0.84	0.81	0.83
query16	0.36	0.35	0.36
query17	0.95	0.97	1.04
query18	0.23	0.23	0.25
query19	1.85	1.72	1.74
query20	0.02	0.01	0.01
query21	15.44	0.65	0.65
query22	3.94	7.73	1.62
query23	18.25	1.42	1.27
query24	2.11	0.22	0.22
query25	0.16	0.10	0.08
query26	0.26	0.18	0.18
query27	0.07	0.09	0.08
query28	13.23	1.02	0.99
query29	12.60	3.29	3.25
query30	0.25	0.07	0.07
query31	2.85	0.39	0.40
query32	3.27	0.48	0.47
query33	2.90	2.92	2.90
query34	17.10	4.40	4.41
query35	4.50	4.42	4.46
query36	0.63	0.46	0.45
query37	0.18	0.15	0.15
query38	0.15	0.14	0.15
query39	0.04	0.03	0.03
query40	0.18	0.13	0.14
query41	0.10	0.05	0.04
query42	0.05	0.04	0.05
query43	0.05	0.04	0.04
Total cold run time: 109.04 s
Total hot run time: 30.18 s

@seawinde
Copy link
Contributor Author

run buildall

1 similar comment
@seawinde
Copy link
Contributor Author

run buildall

@seawinde
Copy link
Contributor Author

run feut

@seawinde
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 39522 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 6f968b9f74e621b4d9f6b64c278c7367939ddbf6, data reload: false

------ Round 1 ----------------------------------
q1	17616	4301	4246	4246
q2	2022	195	186	186
q3	10455	1097	1025	1025
q4	10206	883	817	817
q5	7515	2655	2720	2655
q6	216	136	131	131
q7	936	599	606	599
q8	9219	2036	2063	2036
q9	8884	6507	6450	6450
q10	8997	3726	3705	3705
q11	441	238	236	236
q12	441	232	224	224
q13	17765	2979	2933	2933
q14	248	217	223	217
q15	506	480	470	470
q16	511	377	375	375
q17	958	659	679	659
q18	7847	7440	7314	7314
q19	6548	1439	1482	1439
q20	657	333	350	333
q21	4894	3144	3143	3143
q22	376	332	329	329
Total cold run time: 117258 ms
Total hot run time: 39522 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4440	4221	4241	4221
q2	358	254	261	254
q3	2969	2876	2933	2876
q4	1943	1659	1661	1659
q5	5638	5558	5553	5553
q6	233	129	128	128
q7	2178	1877	1924	1877
q8	3322	3428	3410	3410
q9	8756	8745	8889	8745
q10	4068	4001	3689	3689
q11	600	489	488	488
q12	837	670	631	631
q13	16370	3181	3213	3181
q14	304	260	300	260
q15	538	507	494	494
q16	473	435	430	430
q17	1804	1525	1503	1503
q18	8203	8685	8418	8418
q19	3867	1753	1730	1730
q20	3197	1938	1986	1938
q21	10339	5270	4957	4957
q22	711	564	536	536
Total cold run time: 81148 ms
Total hot run time: 56978 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 173457 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 6f968b9f74e621b4d9f6b64c278c7367939ddbf6, data reload: false

query1	929	388	374	374
query2	6469	2438	2360	2360
query3	6634	206	208	206
query4	19633	17498	17130	17130
query5	3595	468	452	452
query6	239	166	157	157
query7	4580	288	298	288
query8	312	289	294	289
query9	8838	2427	2370	2370
query10	560	285	283	283
query11	10569	10035	10137	10035
query12	122	86	88	86
query13	1629	350	364	350
query14	9740	7367	7412	7367
query15	230	195	190	190
query16	7679	260	253	253
query17	1929	527	504	504
query18	1714	277	278	277
query19	200	161	159	159
query20	116	85	84	84
query21	204	129	121	121
query22	4372	4005	3972	3972
query23	33673	33579	33696	33579
query24	10770	2926	2920	2920
query25	580	382	355	355
query26	706	156	149	149
query27	2296	326	312	312
query28	5799	2107	2106	2106
query29	939	608	613	608
query30	268	157	157	157
query31	1008	771	766	766
query32	94	56	57	56
query33	696	280	277	277
query34	895	474	469	469
query35	732	621	610	610
query36	1113	957	974	957
query37	147	69	78	69
query38	2973	2854	2812	2812
query39	905	832	815	815
query40	215	130	126	126
query41	55	51	54	51
query42	111	104	101	101
query43	603	571	535	535
query44	1092	707	722	707
query45	188	162	159	159
query46	1062	729	721	721
query47	1879	1797	1807	1797
query48	359	292	295	292
query49	836	386	407	386
query50	759	380	394	380
query51	6831	6641	6734	6641
query52	97	94	92	92
query53	356	284	280	280
query54	901	438	436	436
query55	76	72	74	72
query56	262	257	254	254
query57	1127	1039	1051	1039
query58	248	254	230	230
query59	3490	3434	3036	3036
query60	275	259	272	259
query61	90	99	107	99
query62	605	433	460	433
query63	314	288	294	288
query64	8582	2199	1752	1752
query65	3133	3100	3082	3082
query66	736	317	323	317
query67	15522	15051	14847	14847
query68	4500	520	525	520
query69	513	415	360	360
query70	1174	1123	1145	1123
query71	394	283	266	266
query72	7821	5887	5639	5639
query73	745	320	317	317
query74	5944	5505	5572	5505
query75	3334	2641	2633	2633
query76	2690	972	876	876
query77	613	296	293	293
query78	10608	9713	9725	9713
query79	2431	513	512	512
query80	1885	466	465	465
query81	548	220	219	219
query82	829	99	104	99
query83	337	164	159	159
query84	271	87	85	85
query85	1440	273	264	264
query86	484	328	312	312
query87	3249	3097	3041	3041
query88	3962	2333	2329	2329
query89	466	377	374	374
query90	1761	181	185	181
query91	129	98	94	94
query92	55	47	51	47
query93	2317	489	483	483
query94	1162	185	177	177
query95	399	307	312	307
query96	583	258	262	258
query97	3228	3067	3041	3041
query98	217	201	194	194
query99	1216	846	835	835
Total cold run time: 268996 ms
Total hot run time: 173457 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 30.8 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 6f968b9f74e621b4d9f6b64c278c7367939ddbf6, data reload: false

query1	0.04	0.03	0.03
query2	0.08	0.04	0.04
query3	0.22	0.05	0.05
query4	1.68	0.06	0.08
query5	0.51	0.47	0.50
query6	1.13	0.73	0.74
query7	0.02	0.01	0.02
query8	0.04	0.04	0.04
query9	0.53	0.49	0.48
query10	0.55	0.54	0.54
query11	0.15	0.11	0.11
query12	0.14	0.13	0.12
query13	0.60	0.59	0.60
query14	0.79	0.80	0.78
query15	0.85	0.82	0.81
query16	0.37	0.35	0.36
query17	1.01	1.00	0.95
query18	0.20	0.25	0.24
query19	1.77	1.73	1.70
query20	0.01	0.01	0.01
query21	15.41	0.66	0.65
query22	4.02	7.29	2.35
query23	18.29	1.36	1.21
query24	2.19	0.23	0.22
query25	0.15	0.08	0.09
query26	0.26	0.18	0.17
query27	0.08	0.09	0.08
query28	13.17	1.03	0.99
query29	12.56	3.27	3.22
query30	0.26	0.07	0.05
query31	2.87	0.40	0.39
query32	3.27	0.48	0.47
query33	2.84	2.88	2.92
query34	17.12	4.43	4.44
query35	4.48	4.46	4.47
query36	0.65	0.45	0.47
query37	0.18	0.15	0.15
query38	0.16	0.14	0.15
query39	0.04	0.03	0.04
query40	0.17	0.14	0.14
query41	0.09	0.05	0.04
query42	0.05	0.05	0.05
query43	0.04	0.04	0.04
Total cold run time: 109.04 s
Total hot run time: 30.8 s

Copy link
Contributor

@zddr zddr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be strange to set enable_dondeterministic_function to false through the alter statement after creating a materialized view, but it does not affect the business logic

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jun 21, 2024
@morrySnow morrySnow merged commit 35ebef6 into apache:master Jun 21, 2024
iszhangpch pushed a commit to iszhangpch/doris-p that referenced this pull request Jun 21, 2024
…async mv (apache#36111)

Support to use current_date() when create async materialized view by
adding
'enable_nondeterministic_function' = 'true' in properties when create
materialized view. `enable_nondeterministic_function` is default false.

Here is a example, it will success

>        CREATE MATERIALIZED VIEW mv_name
>        BUILD DEFERRED REFRESH AUTO ON MANUAL
>        DISTRIBUTED BY RANDOM BUCKETS 2
>        PROPERTIES (
>        'replication_num' = '1',
>        'enable_nondeterministic_function' = 'true'
>        )
>        AS
>       SELECT *, unix_timestamp(k3, '%Y-%m-%d %H:%i-%s') from ${tableName} where current_date() > k3;

Note:
unix_timestamp is nondeterministic when has no params. it is
deterministic when has params which means format column k3 date

another example, it will success

>        CREATE MATERIALIZED VIEW mv_name
>        BUILD DEFERRED REFRESH AUTO ON MANUAL
>        DISTRIBUTED BY RANDOM BUCKETS 2
>        PROPERTIES (
>        'replication_num' = '1',
>        'enable_nondeterministic_function' = 'true'
>        )
>        AS
>       SELECT *, unix_timestamp() from ${tableName} where current_date() > k3;

though unix_timestamp() is nondeterministic, we add
'enable_date_nondeterministic_function' = 'true' in properties
dataroaring pushed a commit that referenced this pull request Jun 21, 2024
…async mv (#36111)

Support to use current_date() when create async materialized view by
adding
'enable_nondeterministic_function' = 'true' in properties when create
materialized view. `enable_nondeterministic_function` is default false.

Here is a example, it will success

>        CREATE MATERIALIZED VIEW mv_name
>        BUILD DEFERRED REFRESH AUTO ON MANUAL
>        DISTRIBUTED BY RANDOM BUCKETS 2
>        PROPERTIES (
>        'replication_num' = '1',
>        'enable_nondeterministic_function' = 'true'
>        )
>        AS
>       SELECT *, unix_timestamp(k3, '%Y-%m-%d %H:%i-%s') from ${tableName} where current_date() > k3;

Note:
unix_timestamp is nondeterministic when has no params. it is
deterministic when has params which means format column k3 date

another example, it will success

>        CREATE MATERIALIZED VIEW mv_name
>        BUILD DEFERRED REFRESH AUTO ON MANUAL
>        DISTRIBUTED BY RANDOM BUCKETS 2
>        PROPERTIES (
>        'replication_num' = '1',
>        'enable_nondeterministic_function' = 'true'
>        )
>        AS
>       SELECT *, unix_timestamp() from ${tableName} where current_date() > k3;

though unix_timestamp() is nondeterministic, we add
'enable_date_nondeterministic_function' = 'true' in properties
seawinde added a commit to seawinde/doris that referenced this pull request Jul 11, 2024
…async mv (apache#36111)

Support to use current_date() when create async materialized view by
adding
'enable_nondeterministic_function' = 'true' in properties when create
materialized view. `enable_nondeterministic_function` is default false.

Here is a example, it will success

>        CREATE MATERIALIZED VIEW mv_name
>        BUILD DEFERRED REFRESH AUTO ON MANUAL
>        DISTRIBUTED BY RANDOM BUCKETS 2
>        PROPERTIES (
>        'replication_num' = '1',
>        'enable_nondeterministic_function' = 'true'
>        )
>        AS
>       SELECT *, unix_timestamp(k3, '%Y-%m-%d %H:%i-%s') from ${tableName} where current_date() > k3;

Note:
unix_timestamp is nondeterministic when has no params. it is
deterministic when has params which means format column k3 date

another example, it will success

>        CREATE MATERIALIZED VIEW mv_name
>        BUILD DEFERRED REFRESH AUTO ON MANUAL
>        DISTRIBUTED BY RANDOM BUCKETS 2
>        PROPERTIES (
>        'replication_num' = '1',
>        'enable_nondeterministic_function' = 'true'
>        )
>        AS
>       SELECT *, unix_timestamp() from ${tableName} where current_date() > k3;

though unix_timestamp() is nondeterministic, we add
'enable_date_nondeterministic_function' = 'true' in properties
morrySnow pushed a commit that referenced this pull request Jul 12, 2024
cherry-pick from master
pr: #36318
commitId: c199947

pr: #36111
commitId: 35ebef6

pr: #36175
commitId: 4c8e66b

pr: #36414
commitId: 5e009b5

pr: #36770
commitId: 19e2126

pr: #36567
commitId: 3da8351
starocean999 pushed a commit that referenced this pull request Aug 26, 2024
…a expression is nondeterministic or not (#39801)

## Proposed changes

In #36111, we add `isDeterministic`
method in class `ExpressionTrait` to identify the expression is
deterministic or not.

But `unix_timestamp` doesn't extend Nondeterministic, but it is not
deterministic when it's children is empty. and is not deterministic when
children is not empty. If we use` instanceOf Nondeterministic `to
indentify if expression is is not deterministic, that is confused.

So we do something as fllowing:
1. Remove Nondeterministic class, and use `isDeterministic` to indentify
it's deterministic.
2. Add `containsNondeterministic` method in `ExpressionTrait` to
identify it contains nondeterministic expression or not.
3. `isDeterministic` only identify current expression is deterministic
or not. would identify if contains nondeterministic or not
seawinde added a commit to seawinde/doris that referenced this pull request Aug 29, 2024
…a expression is nondeterministic or not (apache#39801)

## Proposed changes

In apache#36111, we add `isDeterministic`
method in class `ExpressionTrait` to identify the expression is
deterministic or not.

But `unix_timestamp` doesn't extend Nondeterministic, but it is not
deterministic when it's children is empty. and is not deterministic when
children is not empty. If we use` instanceOf Nondeterministic `to
indentify if expression is is not deterministic, that is confused.

So we do something as fllowing:
1. Remove Nondeterministic class, and use `isDeterministic` to indentify
it's deterministic.
2. Add `containsNondeterministic` method in `ExpressionTrait` to
identify it contains nondeterministic expression or not.
3. `isDeterministic` only identify current expression is deterministic
or not. would identify if contains nondeterministic or not
yiguolei pushed a commit to seawinde/doris that referenced this pull request Aug 29, 2024
…a expression is nondeterministic or not (apache#39801)

## Proposed changes

In apache#36111, we add `isDeterministic`
method in class `ExpressionTrait` to identify the expression is
deterministic or not.

But `unix_timestamp` doesn't extend Nondeterministic, but it is not
deterministic when it's children is empty. and is not deterministic when
children is not empty. If we use` instanceOf Nondeterministic `to
indentify if expression is is not deterministic, that is confused.

So we do something as fllowing:
1. Remove Nondeterministic class, and use `isDeterministic` to indentify
it's deterministic.
2. Add `containsNondeterministic` method in `ExpressionTrait` to
identify it contains nondeterministic expression or not.
3. `isDeterministic` only identify current expression is deterministic
or not. would identify if contains nondeterministic or not
dataroaring pushed a commit that referenced this pull request Sep 26, 2024
…a expression is nondeterministic or not (#39801)

## Proposed changes

In #36111, we add `isDeterministic`
method in class `ExpressionTrait` to identify the expression is
deterministic or not.

But `unix_timestamp` doesn't extend Nondeterministic, but it is not
deterministic when it's children is empty. and is not deterministic when
children is not empty. If we use` instanceOf Nondeterministic `to
indentify if expression is is not deterministic, that is confused.

So we do something as fllowing:
1. Remove Nondeterministic class, and use `isDeterministic` to indentify
it's deterministic.
2. Add `containsNondeterministic` method in `ExpressionTrait` to
identify it contains nondeterministic expression or not.
3. `isDeterministic` only identify current expression is deterministic
or not. would identify if contains nondeterministic or not
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants