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](table-func) fix explode_map with alias #39757

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

amorynan
Copy link
Contributor

Proposed changes

when we use sql

select 
    a.name,
    tmp.k,
    tmp.v
from (
    select 
        'zhangsan' name,
        map(1,20,2,30) score
)a lateral view explode_map(score)  tmp as k,v;

errCode = 2, detailMessage = Unknown table 'v'

after this pr:

mysql> select      a.name,     tmp.k,     tmp.v from (     select          'zhangsan' name,         map(1,20,2,30) score )a lateral view explode_map(score)  tmp as k,v;
+----------+------+------+
| name     | k    | v    |
+----------+------+------+
| zhangsan |    1 |   20 |
| zhangsan |    2 |   30 |
+----------+------+------+
2 rows in set (0.31 sec)

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.

@amorynan
Copy link
Contributor Author

buildall

@eldenmoon eldenmoon requested a review from morrySnow August 22, 2024 11:38
@yiguolei yiguolei added usercase Important user case type label p0_w labels Aug 22, 2024
@amorynan
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17607	4847	4279	4279
q2	2009	187	181	181
q3	11891	1021	1100	1021
q4	10525	742	790	742
q5	7777	2847	2712	2712
q6	219	138	138	138
q7	968	608	599	599
q8	9314	2072	2069	2069
q9	7139	6555	6518	6518
q10	6978	2241	2302	2241
q11	479	242	244	242
q12	421	228	227	227
q13	19087	3062	3036	3036
q14	276	232	220	220
q15	529	484	503	484
q16	490	414	391	391
q17	972	661	716	661
q18	7255	6803	6786	6786
q19	1387	1063	983	983
q20	686	337	328	328
q21	3974	3028	3100	3028
q22	1110	1008	1003	1003
Total cold run time: 111093 ms
Total hot run time: 37889 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4344	4282	4237	4237
q2	366	262	271	262
q3	2906	2637	2681	2637
q4	1930	1668	1621	1621
q5	5609	5627	5734	5627
q6	235	139	149	139
q7	2284	1838	1856	1838
q8	3255	3416	3469	3416
q9	8787	8781	8742	8742
q10	3612	3409	3291	3291
q11	615	502	518	502
q12	839	696	688	688
q13	16093	3259	3285	3259
q14	321	291	287	287
q15	536	500	502	500
q16	504	439	440	439
q17	1866	1548	1512	1512
q18	8149	7643	7822	7643
q19	1761	1705	1462	1462
q20	2130	1951	1919	1919
q21	5939	5377	5516	5377
q22	1139	991	1049	991
Total cold run time: 73220 ms
Total hot run time: 56389 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 192670 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 02b932c872b32cadab4a1eb042da4409b9744ec3, data reload: false

query1	1258	883	886	883
query2	6437	1965	1869	1869
query3	10613	4006	3953	3953
query4	59461	26354	23338	23338
query5	5580	508	502	502
query6	425	155	157	155
query7	5788	298	303	298
query8	301	213	218	213
query9	8738	2497	2478	2478
query10	480	271	256	256
query11	17429	14943	15386	14943
query12	154	102	106	102
query13	1514	387	397	387
query14	11344	7869	7523	7523
query15	242	178	173	173
query16	7148	482	498	482
query17	1164	586	582	582
query18	2017	315	298	298
query19	303	147	145	145
query20	121	109	108	108
query21	212	103	103	103
query22	4841	4895	5113	4895
query23	34631	33444	33370	33370
query24	5921	2826	2810	2810
query25	548	408	400	400
query26	692	161	158	158
query27	1772	277	286	277
query28	3994	2073	2039	2039
query29	676	416	427	416
query30	242	155	154	154
query31	941	774	758	758
query32	78	57	58	57
query33	463	290	296	290
query34	859	472	464	464
query35	833	720	719	719
query36	1082	935	931	931
query37	138	84	81	81
query38	3998	3774	3864	3774
query39	1475	1403	1397	1397
query40	201	120	118	118
query41	48	46	50	46
query42	119	102	100	100
query43	505	466	474	466
query44	1104	756	748	748
query45	198	167	163	163
query46	1093	778	751	751
query47	1879	1798	1813	1798
query48	366	297	292	292
query49	783	439	443	439
query50	809	417	422	417
query51	7240	7012	7058	7012
query52	99	88	91	88
query53	260	182	186	182
query54	583	468	478	468
query55	80	76	83	76
query56	283	271	268	268
query57	1167	1057	1043	1043
query58	227	255	252	252
query59	3023	2805	2829	2805
query60	298	264	270	264
query61	101	96	114	96
query62	759	665	639	639
query63	214	182	184	182
query64	4247	2237	1771	1771
query65	3217	3165	3154	3154
query66	685	334	341	334
query67	15494	15278	15266	15266
query68	4475	577	559	559
query69	471	292	272	272
query70	1129	1168	1120	1120
query71	449	279	289	279
query72	6447	2304	2070	2070
query73	773	320	327	320
query74	9398	8933	8834	8834
query75	3400	2733	2742	2733
query76	2262	1039	977	977
query77	601	339	313	313
query78	9705	9036	9043	9036
query79	1079	546	524	524
query80	821	541	511	511
query81	558	225	226	225
query82	256	143	137	137
query83	252	196	149	149
query84	252	74	75	74
query85	874	290	283	283
query86	397	304	288	288
query87	4398	4227	4155	4155
query88	3014	2289	2275	2275
query89	379	286	283	283
query90	1979	199	197	197
query91	124	100	98	98
query92	63	49	52	49
query93	2029	548	544	544
query94	753	301	291	291
query95	348	259	265	259
query96	607	270	269	269
query97	3204	3192	3079	3079
query98	212	213	204	204
query99	1513	1261	1244	1244
Total cold run time: 311217 ms
Total hot run time: 192670 ms

@doris-robot
Copy link

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

query1	0.05	0.04	0.04
query2	0.07	0.04	0.04
query3	0.22	0.05	0.05
query4	1.67	0.09	0.10
query5	0.51	0.55	0.50
query6	1.12	0.74	0.73
query7	0.02	0.01	0.01
query8	0.06	0.05	0.05
query9	0.56	0.48	0.50
query10	0.54	0.54	0.54
query11	0.16	0.12	0.12
query12	0.15	0.12	0.12
query13	0.63	0.59	0.60
query14	0.76	0.84	0.77
query15	0.85	0.82	0.82
query16	0.37	0.38	0.42
query17	1.02	1.02	1.03
query18	0.20	0.21	0.20
query19	1.83	1.86	1.88
query20	0.01	0.01	0.01
query21	15.41	0.67	0.66
query22	4.52	7.43	1.62
query23	18.24	1.39	1.26
query24	2.07	0.24	0.23
query25	0.15	0.08	0.08
query26	0.27	0.17	0.17
query27	0.08	0.08	0.07
query28	13.23	1.01	1.00
query29	12.59	3.27	3.30
query30	0.24	0.06	0.05
query31	2.88	0.40	0.40
query32	3.24	0.48	0.48
query33	2.98	3.01	3.01
query34	16.92	4.40	4.38
query35	4.49	4.38	4.39
query36	0.65	0.50	0.49
query37	0.18	0.16	0.16
query38	0.16	0.15	0.15
query39	0.05	0.03	0.03
query40	0.16	0.12	0.13
query41	0.09	0.05	0.05
query42	0.06	0.05	0.05
query43	0.05	0.04	0.04
Total cold run time: 109.51 s
Total hot run time: 30.57 s

Copy link
Member

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

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

@github-actions github-actions bot added approved Indicates a PR has been approved by one committer. reviewed labels Aug 27, 2024
Copy link
Contributor

PR approved by anyone and no changes requested.

@yiguolei yiguolei merged commit f8043cd into apache:master Aug 27, 2024
29 of 31 checks passed
yiguolei pushed a commit that referenced this pull request Aug 27, 2024
## Proposed changes
backport: #39757
Issue Number: close #xxx

<!--Describe your changes.-->
dataroaring pushed a commit that referenced this pull request Sep 3, 2024
## Proposed changes
when we use sql 
```
select 
    a.name,
    tmp.k,
    tmp.v
from (
    select 
        'zhangsan' name,
        map(1,20,2,30) score
)a lateral view explode_map(score)  tmp as k,v;

errCode = 2, detailMessage = Unknown table 'v'
```
after this pr:
```
mysql> select      a.name,     tmp.k,     tmp.v from (     select          'zhangsan' name,         map(1,20,2,30) score )a lateral view explode_map(score)  tmp as k,v;
+----------+------+------+
| name     | k    | v    |
+----------+------+------+
| zhangsan |    1 |   20 |
| zhangsan |    2 |   30 |
+----------+------+------+
2 rows in set (0.31 sec)
```
Issue Number: close #xxx

<!--Describe your changes.-->
@yiguolei yiguolei mentioned this pull request Sep 5, 2024
3 tasks
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.6-merged dev/3.0.2-merged p0_w reviewed usercase Important user case type label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants