Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](nereids)decimal and datetime literal comparison should compare datatype too #36055

Merged
merged 2 commits into from
Jun 11, 2024

Conversation

starocean999
Copy link
Contributor

@starocean999 starocean999 commented Jun 7, 2024

this pr revert #35948 and fix the bug in correct way.

The root cause is decimal literal's comparison only compare value, we should also compare their datatype as well as datetime literal.

suppose
a=0 with type decimal(2,1)
b=0 with type decimal(3,1)
we have:
a.equals(b) returns false

Proposed changes

Issue Number: close #xxx

@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.

@starocean999
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17771	4640	4379	4379
q2	2638	195	197	195
q3	11185	1157	1207	1157
q4	10735	832	823	823
q5	7729	2721	2659	2659
q6	223	137	138	137
q7	970	606	608	606
q8	9342	2086	2077	2077
q9	8963	6476	6441	6441
q10	8885	3740	3684	3684
q11	465	245	258	245
q12	431	231	228	228
q13	17759	2989	3005	2989
q14	258	215	226	215
q15	516	474	456	456
q16	509	386	373	373
q17	941	686	722	686
q18	8137	7563	7531	7531
q19	6638	1543	1412	1412
q20	663	317	308	308
q21	4908	3874	3148	3148
q22	400	345	339	339
Total cold run time: 120066 ms
Total hot run time: 40088 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4443	4280	4235	4235
q2	363	277	281	277
q3	2958	2798	2749	2749
q4	1860	1626	1600	1600
q5	5248	5250	5280	5250
q6	219	129	129	129
q7	2104	1749	1692	1692
q8	3210	3322	3283	3283
q9	8329	8343	8372	8343
q10	3889	3657	3683	3657
q11	580	476	489	476
q12	780	604	615	604
q13	17695	3011	3001	3001
q14	282	271	263	263
q15	512	473	479	473
q16	474	395	412	395
q17	1779	1466	1471	1466
q18	7678	7338	7464	7338
q19	1683	1548	1562	1548
q20	1960	1788	1794	1788
q21	4805	4695	4806	4695
q22	601	552	508	508
Total cold run time: 71452 ms
Total hot run time: 53770 ms
@doris-robot
Copy link

TPC-DS: Total hot run time: 172094 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 28bdd4837f56398160a6541b68ba3e78fbc5d4a6, data reload: false

query1	936	385	387	385
query2	6468	2390	2248	2248
query3	6646	209	208	208
query4	19367	17213	17127	17127
query5	4142	466	459	459
query6	254	166	168	166
query7	4593	299	294	294
query8	320	295	299	295
query9	8546	2432	2383	2383
query10	442	302	278	278
query11	10645	10028	9888	9888
query12	141	89	88	88
query13	1641	370	364	364
query14	10132	7587	7015	7015
query15	236	188	181	181
query16	7824	253	256	253
query17	1824	525	504	504
query18	1952	270	285	270
query19	194	155	149	149
query20	90	84	83	83
query21	218	138	133	133
query22	4289	4192	4054	4054
query23	33794	32992	32970	32970
query24	11751	2833	2794	2794
query25	695	350	367	350
query26	1785	157	162	157
query27	2963	319	321	319
query28	7654	2031	2024	2024
query29	1092	618	592	592
query30	295	147	148	147
query31	979	755	729	729
query32	96	52	54	52
query33	748	285	285	285
query34	952	482	465	465
query35	763	613	620	613
query36	1074	943	910	910
query37	179	72	104	72
query38	2895	2729	2725	2725
query39	853	771	785	771
query40	275	127	127	127
query41	55	53	54	53
query42	114	100	95	95
query43	588	558	550	550
query44	1276	723	746	723
query45	198	158	157	157
query46	1077	728	717	717
query47	1831	1762	1772	1762
query48	387	292	298	292
query49	1170	410	414	410
query50	784	398	387	387
query51	6751	6700	6622	6622
query52	102	100	89	89
query53	353	291	295	291
query54	956	443	446	443
query55	73	74	72	72
query56	283	259	294	259
query57	1155	1053	1054	1053
query58	242	241	264	241
query59	3425	3288	3293	3288
query60	302	277	273	273
query61	90	93	111	93
query62	646	455	428	428
query63	325	287	294	287
query64	9856	2266	1741	1741
query65	3167	3081	3116	3081
query66	1359	336	332	332
query67	15363	15048	14896	14896
query68	4576	550	537	537
query69	458	318	317	317
query70	1168	1075	1162	1075
query71	390	275	270	270
query72	7198	5595	5594	5594
query73	768	323	322	322
query74	5980	5486	5443	5443
query75	3394	2695	2669	2669
query76	2610	927	947	927
query77	467	304	364	304
query78	10339	9869	9590	9590
query79	2569	519	519	519
query80	1171	473	481	473
query81	585	221	216	216
query82	796	105	103	103
query83	242	165	165	165
query84	243	85	83	83
query85	1605	286	272	272
query86	502	274	308	274
query87	3234	3062	3129	3062
query88	4139	2311	2318	2311
query89	477	386	379	379
query90	1769	191	193	191
query91	128	99	96	96
query92	71	48	51	48
query93	1803	517	507	507
query94	1269	188	184	184
query95	402	308	311	308
query96	579	268	257	257
query97	3158	3100	2994	2994
query98	220	203	191	191
query99	1138	851	854	851
Total cold run time: 275119 ms
Total hot run time: 172094 ms
@doris-robot
Copy link

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

query1	0.05	0.03	0.04
query2	0.09	0.04	0.04
query3	0.23	0.05	0.06
query4	1.67	0.10	0.07
query5	0.50	0.49	0.50
query6	1.14	0.73	0.73
query7	0.02	0.01	0.02
query8	0.05	0.04	0.05
query9	0.55	0.48	0.50
query10	0.53	0.53	0.54
query11	0.15	0.11	0.12
query12	0.15	0.13	0.13
query13	0.60	0.58	0.58
query14	0.78	0.77	0.79
query15	0.84	0.82	0.81
query16	0.36	0.36	0.35
query17	0.99	1.00	0.99
query18	0.21	0.23	0.23
query19	1.92	1.68	1.70
query20	0.02	0.01	0.01
query21	15.71	0.67	0.64
query22	4.41	7.24	1.85
query23	18.29	1.44	1.39
query24	2.14	0.24	0.23
query25	0.16	0.08	0.09
query26	0.27	0.17	0.17
query27	0.08	0.08	0.09
query28	13.19	1.02	0.99
query29	13.17	3.29	3.24
query30	0.27	0.09	0.08
query31	2.82	0.40	0.39
query32	3.25	0.48	0.47
query33	2.92	2.89	2.94
query34	16.99	4.43	4.38
query35	4.45	4.52	4.43
query36	0.64	0.47	0.47
query37	0.18	0.15	0.15
query38	0.16	0.14	0.14
query39	0.05	0.04	0.03
query40	0.18	0.15	0.14
query41	0.09	0.05	0.05
query42	0.06	0.05	0.05
query43	0.04	0.04	0.05
Total cold run time: 110.37 s
Total hot run time: 30.51 s
@morrySnow morrySnow added usercase Important user case type label dev/2.0.x dev/2.1.x labels Jun 7, 2024
@starocean999
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17638	4319	4338	4319
q2	2028	193	196	193
q3	10440	1158	1094	1094
q4	10200	778	764	764
q5	7539	2671	2734	2671
q6	223	139	136	136
q7	947	625	606	606
q8	9218	2062	2059	2059
q9	8951	6478	6443	6443
q10	8962	3708	3744	3708
q11	435	238	241	238
q12	522	237	231	231
q13	17887	2973	2992	2973
q14	275	221	232	221
q15	517	471	466	466
q16	533	395	389	389
q17	957	657	747	657
q18	8046	7440	7412	7412
q19	5378	1460	1577	1460
q20	645	327	315	315
q21	5030	3246	3990	3246
q22	389	331	338	331
Total cold run time: 116760 ms
Total hot run time: 39932 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4375	4272	4269	4269
q2	365	270	260	260
q3	2945	2950	2909	2909
q4	2026	1758	1766	1758
q5	5581	5493	5458	5458
q6	216	132	133	132
q7	2252	1867	1820	1820
q8	3290	3442	3416	3416
q9	8682	8664	8858	8664
q10	4104	3843	3745	3745
q11	595	504	500	500
q12	800	656	670	656
q13	17206	3233	3215	3215
q14	332	278	280	278
q15	518	491	498	491
q16	491	469	433	433
q17	1813	1523	1490	1490
q18	8178	7952	7736	7736
q19	1850	1503	1607	1503
q20	3087	1860	1869	1860
q21	5035	4926	4660	4660
q22	645	549	583	549
Total cold run time: 74386 ms
Total hot run time: 55802 ms
@doris-robot
Copy link

TPC-DS: Total hot run time: 171889 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 e5ebb0b62611bdce7397d01d1b150e856ff341a3, data reload: false

query1	917	385	384	384
query2	6444	2574	2427	2427
query3	6634	206	203	203
query4	19693	17241	17161	17161
query5	3623	476	477	476
query6	247	175	179	175
query7	4598	311	295	295
query8	328	297	299	297
query9	8590	2388	2392	2388
query10	554	323	300	300
query11	10469	10094	10090	10090
query12	122	92	90	90
query13	1655	379	373	373
query14	8879	7961	8161	7961
query15	252	204	210	204
query16	7744	293	285	285
query17	1872	579	563	563
query18	1981	286	293	286
query19	234	173	164	164
query20	110	93	89	89
query21	212	151	141	141
query22	4885	4437	4375	4375
query23	34273	33512	33509	33509
query24	10973	2931	2778	2778
query25	625	353	350	350
query26	1096	155	152	152
query27	2248	324	320	320
query28	6445	2041	2037	2037
query29	855	627	609	609
query30	260	151	150	150
query31	951	713	750	713
query32	95	56	53	53
query33	744	297	278	278
query34	888	460	474	460
query35	730	613	618	613
query36	1093	951	953	951
query37	140	70	67	67
query38	2892	2736	2756	2736
query39	859	823	843	823
query40	212	123	122	122
query41	53	51	48	48
query42	122	95	106	95
query43	588	557	539	539
query44	1233	723	735	723
query45	190	162	162	162
query46	1072	720	723	720
query47	1858	1748	1756	1748
query48	363	290	294	290
query49	886	403	423	403
query50	771	394	390	390
query51	6807	6750	6706	6706
query52	120	91	91	91
query53	357	301	292	292
query54	954	434	435	434
query55	73	71	73	71
query56	281	254	258	254
query57	1125	1039	1058	1039
query58	245	243	240	240
query59	3727	3295	3133	3133
query60	297	293	272	272
query61	91	83	83	83
query62	586	455	455	455
query63	331	298	300	298
query64	8831	2250	1763	1763
query65	3189	3107	3134	3107
query66	736	338	319	319
query67	15428	15012	14868	14868
query68	5541	540	535	535
query69	608	429	418	418
query70	1172	1097	1141	1097
query71	460	282	272	272
query72	7331	2752	2545	2545
query73	766	324	316	316
query74	5838	5507	5488	5488
query75	3686	2705	2643	2643
query76	3108	881	937	881
query77	610	314	303	303
query78	10396	9900	9986	9900
query79	2739	535	526	526
query80	2219	483	465	465
query81	600	223	228	223
query82	1002	114	105	105
query83	296	167	165	165
query84	269	87	82	82
query85	1274	268	263	263
query86	469	285	305	285
query87	3265	3068	3075	3068
query88	3367	2328	2319	2319
query89	485	404	391	391
query90	1755	191	188	188
query91	149	161	97	97
query92	66	47	56	47
query93	1990	508	506	506
query94	1076	191	184	184
query95	399	310	307	307
query96	603	271	264	264
query97	3196	2988	3013	2988
query98	227	201	205	201
query99	1172	826	841	826
Total cold run time: 271870 ms
Total hot run time: 171889 ms
@doris-robot
Copy link

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

query1	0.04	0.04	0.03
query2	0.08	0.04	0.04
query3	0.23	0.05	0.05
query4	1.68	0.10	0.09
query5	0.50	0.48	0.48
query6	1.13	0.74	0.72
query7	0.02	0.01	0.02
query8	0.05	0.04	0.05
query9	0.55	0.50	0.49
query10	0.57	0.55	0.55
query11	0.16	0.12	0.11
query12	0.15	0.12	0.12
query13	0.60	0.59	0.59
query14	0.78	0.79	0.78
query15	0.83	0.84	0.83
query16	0.36	0.36	0.37
query17	1.01	1.05	1.04
query18	0.22	0.24	0.25
query19	1.80	1.71	1.74
query20	0.02	0.01	0.01
query21	15.42	0.64	0.64
query22	4.56	6.95	2.44
query23	18.32	1.43	1.32
query24	2.09	0.22	0.23
query25	0.14	0.09	0.09
query26	0.27	0.18	0.17
query27	0.07	0.08	0.08
query28	13.23	1.04	1.00
query29	12.58	3.30	3.29
query30	0.26	0.07	0.06
query31	2.85	0.39	0.39
query32	3.28	0.48	0.47
query33	2.93	2.89	3.01
query34	17.11	4.43	4.42
query35	4.54	4.51	4.50
query36	0.67	0.47	0.46
query37	0.18	0.16	0.15
query38	0.15	0.14	0.15
query39	0.04	0.04	0.03
query40	0.17	0.17	0.14
query41	0.09	0.05	0.06
query42	0.06	0.06	0.05
query43	0.04	0.04	0.04
Total cold run time: 109.83 s
Total hot run time: 31.33 s
@starocean999 starocean999 marked this pull request as ready for review June 8, 2024 13:59
morningman pushed a commit that referenced this pull request Jun 8, 2024
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jun 8, 2024
Copy link
Contributor

github-actions bot commented Jun 8, 2024

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

Copy link
Contributor

github-actions bot commented Jun 8, 2024

PR approved by anyone and no changes requested.

@morrySnow morrySnow merged commit ee9fc1a into apache:master Jun 11, 2024
28 of 30 checks passed
morrySnow pushed a commit that referenced this pull request Jun 11, 2024
…datatype too (#36065)

pick from master #36055

this pr revert #35961 and fix the bug in correct way.

The root cause is decimal literal's comparison only compare value, we should also compare their datatype as well as datetime literal.

suppose
a=0 with type decimal(2,1)
b=0 with type decimal(3,1)
we have:
a.equals(b) returns false
dataroaring pushed a commit that referenced this pull request Jun 13, 2024
…datatype too (#36055)

this pr revert #35948 and fix the bug in correct way.

The root cause is decimal literal's comparison only compare value, we
should also compare their datatype as well as datetime literal.

suppose 
a=0 with type decimal(2,1)
b=0 with type decimal(3,1)
we have:
a.equals(b) returns false
@morningman morningman mentioned this pull request Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by one committer. dev/2.0.12-merged dev/2.1.4-merged reviewed usercase Important user case type label
5 participants