Skip to content

Conversation

@morningman
Copy link
Contributor

cherry pick from #42113

…te express is not slot (apache#42113)

## Proposed changes
follow up apache#35335
When the `"case when ... then ... when ... then ... else"` occurs,
function_expr may not exist in the pushed down predicate, but the
handling of null values ​​is still problematic.

table data:
```text
mysql> select o_orderpriority from test_string_dict_filter_orc;
+-----------------+
| o_orderpriority |
+-----------------+
| 5-LOW           |
| 1-URGENT        |
| 5-LOW           |
| NULL            |
| 5-LOW           |
+-----------------+
```

before:
```text
mysql> select count(o_orderpriority) from ( select (case when o_orderpriority = 'x' then '1' when o_orderpriority = 'y' then '2' else '0' end) as o_orderpriority from test_string_dict_filter_orc ) as A where o_orderpriority = '0';
+------------------------+
| count(o_orderpriority) |
+------------------------+
|                      4 |
+------------------------+
```

after:
```text
mysql> select count(o_orderpriority) from ( select (case when o_orderpriority = 'x' then '1' when o_orderpriority = 'y' then '2' else '0' end) as o_orderpriority from test_string_dict_filter_orc ) as A where o_orderpriority = '0';
+------------------------+
| count(o_orderpriority) |
+------------------------+
|                      5 |
+------------------------+
```
@morningman
Copy link
Contributor Author

run buildall

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

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17593	7365	7244	7244
q2	2057	159	148	148
q3	10699	1008	1153	1008
q4	10572	731	810	731
q5	7863	2837	2749	2749
q6	237	150	150	150
q7	1007	628	613	613
q8	9571	1884	1899	1884
q9	8039	6395	6411	6395
q10	6957	2285	2316	2285
q11	451	261	253	253
q12	412	219	222	219
q13	17818	2970	2955	2955
q14	234	219	212	212
q15	560	502	508	502
q16	676	592	602	592
q17	985	626	606	606
q18	7460	6864	6968	6864
q19	2143	855	933	855
q20	564	280	266	266
q21	3858	3246	3025	3025
q22	1110	993	986	986
Total cold run time: 110866 ms
Total hot run time: 40542 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7341	7207	7206	7206
q2	317	226	220	220
q3	2999	2833	2884	2833
q4	2017	1815	1753	1753
q5	5688	5706	5738	5706
q6	225	142	146	142
q7	2229	1788	1756	1756
q8	3363	3439	3386	3386
q9	8875	8908	8740	8740
q10	3534	3544	3479	3479
q11	576	486	494	486
q12	806	630	611	611
q13	16421	3151	3176	3151
q14	299	265	269	265
q15	555	521	526	521
q16	704	662	677	662
q17	1853	1621	1563	1563
q18	8272	7947	7554	7554
q19	1759	1366	1450	1366
q20	2171	1849	1850	1849
q21	9722	5264	5146	5146
q22	1154	1005	1033	1005
Total cold run time: 80880 ms
Total hot run time: 59400 ms

@doris-robot
Copy link

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

query1	1258	926	886	886
query2	6278	2130	2092	2092
query3	10746	3787	3708	3708
query4	67609	24902	23435	23435
query5	5611	474	469	469
query6	486	169	170	169
query7	6312	312	303	303
query8	303	205	208	205
query9	9327	2647	2659	2647
query10	500	276	276	276
query11	18175	15271	15736	15271
query12	164	100	106	100
query13	1632	468	460	460
query14	10957	7323	6648	6648
query15	216	183	171	171
query16	7273	506	474	474
query17	1066	563	556	556
query18	1819	319	311	311
query19	190	153	148	148
query20	112	109	109	109
query21	209	101	102	101
query22	4528	4323	4131	4131
query23	34470	33625	33946	33625
query24	5639	2875	2744	2744
query25	504	409	399	399
query26	681	169	169	169
query27	1671	295	305	295
query28	4368	2514	2473	2473
query29	678	430	422	422
query30	240	157	160	157
query31	1001	772	810	772
query32	75	55	55	55
query33	456	304	297	297
query34	899	504	502	502
query35	844	721	748	721
query36	1049	920	942	920
query37	146	83	89	83
query38	3964	3893	3885	3885
query39	1474	1451	1426	1426
query40	202	100	97	97
query41	45	46	43	43
query42	121	99	95	95
query43	542	497	491	491
query44	1124	762	773	762
query45	197	166	162	162
query46	1137	710	701	701
query47	1920	1814	1844	1814
query48	454	360	336	336
query49	708	392	379	379
query50	805	419	412	412
query51	7007	6874	6896	6874
query52	102	93	89	89
query53	256	203	180	180
query54	569	467	457	457
query55	76	74	74	74
query56	279	261	253	253
query57	1200	1131	1108	1108
query58	219	223	229	223
query59	3114	2954	2829	2829
query60	291	263	262	262
query61	103	99	100	99
query62	756	652	644	644
query63	214	175	177	175
query64	1589	626	625	625
query65	3233	3170	3176	3170
query66	722	305	304	304
query67	15754	15422	15181	15181
query68	3505	541	558	541
query69	615	284	286	284
query70	1163	1138	1142	1138
query71	437	268	269	268
query72	7768	4032	3918	3918
query73	761	335	330	330
query74	10100	8885	8906	8885
query75	4149	2623	2675	2623
query76	3202	957	914	914
query77	769	285	280	280
query78	9823	9254	9099	9099
query79	6707	577	576	576
query80	1192	435	448	435
query81	583	241	245	241
query82	894	142	143	142
query83	388	139	145	139
query84	292	75	83	75
query85	1710	286	292	286
query86	422	290	308	290
query87	4530	4204	4188	4188
query88	4915	2415	2460	2415
query89	420	291	284	284
query90	2039	182	183	182
query91	135	106	105	105
query92	55	48	46	46
query93	5897	542	523	523
query94	996	288	284	284
query95	342	246	245	245
query96	636	277	286	277
query97	3352	3132	3207	3132
query98	219	188	194	188
query99	1733	1401	1282	1282
Total cold run time: 335418 ms
Total hot run time: 193069 ms

@morningman morningman merged commit 4cb275f into apache:branch-3.0 Oct 22, 2024
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.

3 participants