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

branch-3.0: [fix](nereids) fix comparison with date like #45735 #45779

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

github-actions[bot]
Copy link
Contributor

Cherry-picked from #45735

### What problem does this PR solve?

Issue Number: close #xxx

Related PR: #45382

Problem Summary:

#45382 had fix compare date/datev1 with datetime literal wrong cutting.
but it not fix completely.

```
if (right instanceof DateTimeLiteral) {
                    DateTimeLiteral dateTimeLiteral = (DateTimeLiteral) right;
                    right = migrateToDateV2(dateTimeLiteral);
                    if (dateTimeLiteral.getHour() != 0 || dateTimeLiteral.getMinute() != 0
                            || dateTimeLiteral.getSecond() != 0) {
                            ...
                    }
}
```


For the above code, if check right is date time literal, but notice that
datetimev2 literal is datetime literal's child class. so datetimev2
literal will also run the above code. And datetimev2 literal should
check its microseconds not equals to 0.

for example: `date_a = '2020-01-01 00:00:00.01'` should opt as `FALSE`,
but not `date_a = '2020-01-01'`.
@hello-stephen
Copy link
Contributor

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

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring reopened this Dec 23, 2024
@hello-stephen
Copy link
Contributor

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17569	7408	7218	7218
q2	2050	190	164	164
q3	10694	1967	1286	1286
q4	11017	693	685	685
q5	7762	2855	2695	2695
q6	232	149	143	143
q7	944	596	588	588
q8	9576	1893	1949	1893
q9	7975	6394	6346	6346
q10	6998	2253	2284	2253
q11	462	255	255	255
q12	395	207	204	204
q13	17831	2936	3036	2936
q14	243	210	209	209
q15	562	511	523	511
q16	712	597	612	597
q17	953	516	535	516
q18	7093	6528	6466	6466
q19	1471	1050	993	993
q20	455	191	195	191
q21	4134	3066	3092	3066
q22	1074	987	976	976
Total cold run time: 110202 ms
Total hot run time: 40191 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7239	7148	7138	7138
q2	330	232	235	232
q3	2912	2875	2835	2835
q4	1996	1758	1765	1758
q5	5644	5648	5705	5648
q6	229	143	146	143
q7	2150	1743	1803	1743
q8	3338	3534	3502	3502
q9	8756	8831	8769	8769
q10	3522	3482	3477	3477
q11	604	504	485	485
q12	783	591	582	582
q13	16423	3083	3132	3083
q14	314	274	283	274
q15	570	526	533	526
q16	709	697	661	661
q17	1830	1608	1601	1601
q18	8332	7743	7448	7448
q19	8210	1574	1581	1574
q20	2055	1850	1863	1850
q21	5420	5264	5270	5264
q22	1100	1029	1025	1025
Total cold run time: 82466 ms
Total hot run time: 59618 ms

@doris-robot
Copy link

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

query1	1289	931	911	911
query2	6238	2162	2083	2083
query3	10851	4261	4049	4049
query4	66293	27233	23599	23599
query5	5609	468	455	455
query6	530	187	190	187
query7	6161	310	313	310
query8	339	244	245	244
query9	9591	2660	2660	2660
query10	511	272	251	251
query11	18041	15305	15680	15305
query12	161	101	97	97
query13	1562	434	416	416
query14	11139	7729	7223	7223
query15	205	177	180	177
query16	7221	518	476	476
query17	1182	552	566	552
query18	1812	313	300	300
query19	191	169	160	160
query20	116	116	111	111
query21	69	45	44	44
query22	4532	4591	4302	4302
query23	34261	34073	33876	33876
query24	5836	2909	2940	2909
query25	540	420	416	416
query26	686	164	167	164
query27	1879	298	295	295
query28	4400	2524	2557	2524
query29	717	478	469	469
query30	256	172	169	169
query31	996	809	837	809
query32	68	62	60	60
query33	474	298	296	296
query34	917	497	521	497
query35	845	761	760	760
query36	1102	956	951	951
query37	121	75	71	71
query38	4148	4118	4026	4026
query39	1531	1466	1447	1447
query40	142	88	84	84
query41	51	75	47	47
query42	121	102	100	100
query43	531	516	494	494
query44	1145	782	795	782
query45	185	168	172	168
query46	1126	736	717	717
query47	2037	1885	1870	1870
query48	446	372	388	372
query49	736	387	375	375
query50	822	412	411	411
query51	7160	7215	7326	7215
query52	96	95	89	89
query53	256	187	183	183
query54	545	437	445	437
query55	76	78	76	76
query56	257	241	247	241
query57	1161	1114	1103	1103
query58	205	205	198	198
query59	3123	2946	3075	2946
query60	270	252	298	252
query61	107	104	107	104
query62	753	649	691	649
query63	210	189	192	189
query64	1732	668	617	617
query65	3233	3198	3173	3173
query66	665	322	302	302
query67	15505	15175	15169	15169
query68	4505	549	540	540
query69	433	257	252	252
query70	1137	1094	1104	1094
query71	323	248	250	248
query72	6542	3997	3860	3860
query73	736	353	344	344
query74	10285	8906	8948	8906
query75	3304	2590	2633	2590
query76	1995	1054	1039	1039
query77	505	274	274	274
query78	10540	9761	9781	9761
query79	7562	586	580	580
query80	1934	423	412	412
query81	557	244	239	239
query82	1012	111	122	111
query83	256	143	143	143
query84	289	82	81	81
query85	1683	314	348	314
query86	481	303	305	303
query87	4451	4228	4216	4216
query88	5595	2370	2381	2370
query89	414	291	291	291
query90	2024	184	185	184
query91	179	145	143	143
query92	69	49	50	49
query93	6232	533	527	527
query94	901	289	258	258
query95	351	247	249	247
query96	631	286	298	286
query97	3323	3092	3148	3092
query98	241	201	190	190
query99	1555	1304	1313	1304
Total cold run time: 335161 ms
Total hot run time: 196262 ms

@englefly englefly merged commit 8e38de9 into branch-3.0 Dec 23, 2024
19 of 21 checks passed
@github-actions github-actions bot deleted the auto-pick-45735-branch-3.0 branch December 23, 2024 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants