Skip to content

Conversation

@zhangstar333
Copy link
Contributor

@zhangstar333 zhangstar333 commented Jun 25, 2024

Proposed changes

cast '+','-' as int should be return NULL like other char

mysql [ssb]>select cast('a' as int);
+------------------+
| cast('a' as INT) |
+------------------+
|             NULL |
+------------------+
1 row in set (0.02 sec)

mysql [ssb]>select cast('/' as int);
+------------------+
| cast('/' as INT) |
+------------------+
|             NULL |
+------------------+
1 row in set (0.02 sec)

mysql [ssb]>select cast('+' as int);
+------------------+
| cast('+' as INT) |
+------------------+
|                0 |
+------------------+
1 row in set (0.02 sec)

mysql [ssb]>select cast('-' as int);
+------------------+
| cast('-' as INT) |
+------------------+
|                0 |
+------------------+
1 row in set (0.02 sec)

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

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@zhangstar333
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17588	4592	4283	4283
q2	2006	191	193	191
q3	10432	1168	1166	1166
q4	10190	814	729	729
q5	7471	2767	2590	2590
q6	218	134	134	134
q7	963	601	617	601
q8	9243	2092	2084	2084
q9	8966	6566	6514	6514
q10	8964	3706	3694	3694
q11	474	245	238	238
q12	458	229	226	226
q13	17777	3000	3036	3000
q14	276	238	209	209
q15	524	476	475	475
q16	499	376	387	376
q17	975	663	721	663
q18	8149	7561	7400	7400
q19	5143	1454	1508	1454
q20	685	306	321	306
q21	4881	3285	3860	3285
q22	386	345	337	337
Total cold run time: 116268 ms
Total hot run time: 39955 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4536	4235	4238	4235
q2	366	271	268	268
q3	2961	2835	2916	2835
q4	2022	1712	1703	1703
q5	5644	5501	5514	5501
q6	215	130	126	126
q7	2267	1856	1825	1825
q8	3291	3422	3453	3422
q9	8771	8759	8753	8753
q10	4153	3844	3785	3785
q11	607	496	494	494
q12	822	656	637	637
q13	15977	3188	3170	3170
q14	316	299	304	299
q15	517	481	475	475
q16	474	448	425	425
q17	1831	1506	1507	1506
q18	8208	8155	7847	7847
q19	1829	1541	1573	1541
q20	3121	1895	1907	1895
q21	9547	4911	4858	4858
q22	646	564	601	564
Total cold run time: 78121 ms
Total hot run time: 56164 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 174134 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 3d9127e8dc67baccde5473cbc8c6419b9a9d28a9, data reload: false

query1	922	391	374	374
query2	6429	2438	2475	2438
query3	6626	211	211	211
query4	19289	17276	17233	17233
query5	3605	479	452	452
query6	239	175	173	173
query7	4579	296	304	296
query8	321	294	323	294
query9	8473	2399	2375	2375
query10	566	307	275	275
query11	10517	10204	10036	10036
query12	111	83	87	83
query13	1637	405	375	375
query14	10206	6981	7667	6981
query15	222	186	177	177
query16	7774	281	263	263
query17	1573	519	510	510
query18	1981	271	264	264
query19	194	151	152	151
query20	89	83	85	83
query21	200	123	122	122
query22	4334	4111	3991	3991
query23	33886	33763	33817	33763
query24	10604	2896	2848	2848
query25	611	400	368	368
query26	709	155	151	151
query27	2329	327	321	321
query28	5915	2176	2187	2176
query29	911	624	645	624
query30	252	155	156	155
query31	979	779	748	748
query32	96	53	54	53
query33	680	340	293	293
query34	886	467	481	467
query35	742	646	610	610
query36	1099	954	972	954
query37	141	70	76	70
query38	2976	2875	2805	2805
query39	897	857	844	844
query40	214	130	128	128
query41	55	55	53	53
query42	112	105	116	105
query43	602	550	562	550
query44	1071	736	730	730
query45	189	158	163	158
query46	1068	716	706	706
query47	1854	1809	1759	1759
query48	382	312	302	302
query49	843	401	415	401
query50	804	402	382	382
query51	7009	6768	6825	6768
query52	96	93	91	91
query53	356	287	287	287
query54	843	445	444	444
query55	74	72	74	72
query56	275	256	270	256
query57	1166	1037	1070	1037
query58	255	245	250	245
query59	3405	3165	3132	3132
query60	301	265	270	265
query61	95	94	95	94
query62	598	450	452	450
query63	317	295	293	293
query64	8556	2221	1764	1764
query65	3155	3108	3118	3108
query66	741	325	328	325
query67	15504	15178	15135	15135
query68	4550	556	541	541
query69	508	393	350	350
query70	1177	1050	1124	1050
query71	370	276	272	272
query72	7180	5434	5284	5284
query73	736	323	324	323
query74	5922	5522	5536	5522
query75	3323	2664	2730	2664
query76	2199	953	944	944
query77	433	295	300	295
query78	10447	9962	9848	9848
query79	2187	516	511	511
query80	1170	465	458	458
query81	575	219	219	219
query82	703	103	102	102
query83	228	166	164	164
query84	232	84	81	81
query85	1601	283	266	266
query86	507	322	316	316
query87	3273	3101	3111	3101
query88	4140	2369	2334	2334
query89	477	374	384	374
query90	1740	189	187	187
query91	127	97	100	97
query92	56	49	51	49
query93	2422	519	511	511
query94	1160	196	189	189
query95	404	315	308	308
query96	584	269	268	268
query97	3247	3042	3035	3035
query98	215	202	196	196
query99	1191	847	828	828
Total cold run time: 266624 ms
Total hot run time: 174134 ms

@doris-robot
Copy link

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

query1	0.03	0.03	0.03
query2	0.08	0.04	0.04
query3	0.22	0.05	0.05
query4	1.68	0.08	0.08
query5	0.48	0.48	0.51
query6	1.14	0.73	0.72
query7	0.02	0.01	0.01
query8	0.05	0.04	0.04
query9	0.56	0.47	0.49
query10	0.53	0.52	0.54
query11	0.16	0.12	0.12
query12	0.14	0.12	0.13
query13	0.59	0.58	0.59
query14	0.76	0.81	0.78
query15	0.84	0.81	0.82
query16	0.36	0.37	0.36
query17	0.96	0.99	1.03
query18	0.22	0.23	0.24
query19	1.80	1.71	1.70
query20	0.01	0.00	0.00
query21	15.45	0.65	0.64
query22	4.73	6.76	1.85
query23	18.28	1.41	1.33
query24	2.24	0.22	0.22
query25	0.16	0.09	0.08
query26	0.27	0.18	0.18
query27	0.08	0.08	0.08
query28	13.17	1.12	1.09
query29	12.62	3.25	3.25
query30	0.25	0.05	0.06
query31	2.86	0.39	0.40
query32	3.26	0.48	0.46
query33	2.92	2.90	2.89
query34	17.24	4.46	4.48
query35	4.46	4.53	4.54
query36	0.65	0.46	0.47
query37	0.18	0.15	0.16
query38	0.16	0.14	0.14
query39	0.04	0.03	0.04
query40	0.17	0.14	0.15
query41	0.09	0.05	0.05
query42	0.06	0.05	0.04
query43	0.05	0.04	0.04
Total cold run time: 110.02 s
Total hot run time: 30.68 s

@zhangstar333 zhangstar333 changed the title test [Bug](cast) fix cast string to int return wrong result Jun 26, 2024
@zhangstar333
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17587	4429	4332	4332
q2	1997	189	186	186
q3	10476	1183	1029	1029
q4	10198	834	826	826
q5	7472	2705	2628	2628
q6	225	135	132	132
q7	957	603	598	598
q8	9225	2100	2067	2067
q9	9014	6513	6503	6503
q10	9000	3706	3747	3706
q11	476	253	241	241
q12	415	222	221	221
q13	17989	3005	2992	2992
q14	280	223	219	219
q15	515	496	486	486
q16	533	379	373	373
q17	977	705	734	705
q18	8049	7574	7425	7425
q19	6037	1461	1521	1461
q20	657	316	328	316
q21	4931	3208	3946	3208
q22	397	341	352	341
Total cold run time: 117407 ms
Total hot run time: 39995 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4419	4265	4248	4248
q2	368	257	265	257
q3	3006	2884	2887	2884
q4	2022	1729	1772	1729
q5	5586	5472	5504	5472
q6	223	128	131	128
q7	2208	1890	1876	1876
q8	3328	3432	3441	3432
q9	8740	8690	8839	8690
q10	4086	3948	3728	3728
q11	612	511	504	504
q12	828	635	639	635
q13	16220	3157	3162	3157
q14	312	280	275	275
q15	532	485	475	475
q16	492	415	464	415
q17	1830	1524	1525	1524
q18	8216	7982	7740	7740
q19	1819	1562	1587	1562
q20	3048	1950	1898	1898
q21	5189	4900	4922	4900
q22	649	548	564	548
Total cold run time: 73733 ms
Total hot run time: 56077 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 174306 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 1b12955cc8a0ec49e467d5e8735295d82fd9adb6, data reload: false

query1	921	399	387	387
query2	6431	2400	2413	2400
query3	6620	210	211	210
query4	21660	17282	17363	17282
query5	3556	472	481	472
query6	239	168	162	162
query7	4587	299	286	286
query8	341	300	305	300
query9	8464	2486	2463	2463
query10	585	306	279	279
query11	10523	10006	10146	10006
query12	118	83	87	83
query13	1639	372	374	372
query14	9472	7263	7186	7186
query15	233	203	205	203
query16	7709	281	277	277
query17	1383	575	546	546
query18	1956	286	287	286
query19	204	162	165	162
query20	99	94	89	89
query21	210	130	134	130
query22	4275	4153	4109	4109
query23	34034	34173	33690	33690
query24	11226	2893	2908	2893
query25	649	428	424	424
query26	1185	166	163	163
query27	2920	329	330	329
query28	7556	2190	2169	2169
query29	889	643	644	643
query30	259	158	159	158
query31	946	750	741	741
query32	103	54	56	54
query33	759	279	325	279
query34	987	489	505	489
query35	780	651	668	651
query36	1129	969	953	953
query37	165	79	79	79
query38	3003	2792	2802	2792
query39	897	824	820	820
query40	210	130	122	122
query41	55	53	52	52
query42	125	96	98	96
query43	578	560	560	560
query44	1181	739	720	720
query45	204	162	159	159
query46	1080	720	748	720
query47	1874	1756	1737	1737
query48	373	303	302	302
query49	848	407	411	407
query50	766	386	390	386
query51	6911	6830	6748	6748
query52	116	88	96	88
query53	364	293	286	286
query54	909	443	437	437
query55	75	74	73	73
query56	278	258	256	256
query57	1116	1073	1050	1050
query58	260	242	242	242
query59	3461	3205	3115	3115
query60	290	268	272	268
query61	94	95	96	95
query62	609	437	439	437
query63	317	293	289	289
query64	8828	2287	1770	1770
query65	3184	3101	3116	3101
query66	729	327	321	321
query67	15264	14917	14688	14688
query68	8039	540	549	540
query69	609	560	418	418
query70	1214	1094	1078	1078
query71	492	280	277	277
query72	7517	5201	5301	5201
query73	825	335	325	325
query74	5889	5601	5470	5470
query75	4242	2656	2710	2656
query76	4594	973	975	973
query77	698	304	306	304
query78	10748	9867	9762	9762
query79	3514	522	509	509
query80	1200	464	463	463
query81	557	219	222	219
query82	741	114	103	103
query83	206	174	171	171
query84	269	94	87	87
query85	1385	303	281	281
query86	417	304	324	304
query87	3304	3106	3112	3106
query88	4379	2467	2484	2467
query89	484	393	395	393
query90	1857	194	187	187
query91	129	104	100	100
query92	64	50	49	49
query93	4152	507	500	500
query94	1059	195	226	195
query95	405	319	318	318
query96	611	277	269	269
query97	3177	3079	3018	3018
query98	226	201	196	196
query99	1194	849	825	825
Total cold run time: 283008 ms
Total hot run time: 174306 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 1b12955cc8a0ec49e467d5e8735295d82fd9adb6, data reload: false

query1	0.04	0.03	0.02
query2	0.07	0.04	0.04
query3	0.21	0.05	0.04
query4	1.69	0.08	0.09
query5	0.51	0.51	0.49
query6	1.15	0.73	0.72
query7	0.02	0.01	0.01
query8	0.04	0.04	0.04
query9	0.54	0.47	0.52
query10	0.55	0.54	0.55
query11	0.15	0.11	0.11
query12	0.14	0.11	0.11
query13	0.59	0.59	0.59
query14	0.75	0.80	0.79
query15	0.84	0.81	0.81
query16	0.36	0.37	0.37
query17	1.05	1.04	1.04
query18	0.22	0.24	0.24
query19	1.86	1.75	1.69
query20	0.02	0.02	0.01
query21	15.50	0.67	0.66
query22	4.68	7.12	1.87
query23	18.33	1.41	1.25
query24	2.17	0.22	0.23
query25	0.14	0.08	0.08
query26	0.28	0.18	0.18
query27	0.08	0.09	0.07
query28	13.20	1.03	1.01
query29	12.61	3.30	3.25
query30	0.25	0.06	0.06
query31	2.86	0.39	0.38
query32	3.29	0.47	0.46
query33	2.95	2.93	2.90
query34	17.18	4.41	4.39
query35	4.48	4.47	4.47
query36	0.66	0.46	0.46
query37	0.17	0.16	0.16
query38	0.15	0.15	0.14
query39	0.05	0.03	0.04
query40	0.19	0.16	0.14
query41	0.09	0.04	0.05
query42	0.05	0.04	0.04
query43	0.05	0.04	0.04
Total cold run time: 110.21 s
Total hot run time: 30.51 s

Copy link
Contributor

@HappenLee HappenLee left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jun 28, 2024
@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

Copy link
Contributor

@xinyiZzz xinyiZzz left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@wangbo wangbo left a comment

Choose a reason for hiding this comment

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

LGTM

@HappenLee HappenLee merged commit 4012bce into apache:master Jun 28, 2024
zhangstar333 added a commit to zhangstar333/incubator-doris that referenced this pull request Jul 15, 2024
yiguolei pushed a commit that referenced this pull request Jul 15, 2024
…36788) (#37803)

## Proposed changes
cherry-pick from master:
#36788
#36505

<!--Describe your changes.-->
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.1.5-merged dev/3.0.0-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants