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

[feature](serde) support presto compatible output format #37039

Merged
merged 15 commits into from
Jul 3, 2024

Conversation

morningman
Copy link
Contributor

@morningman morningman commented Jun 30, 2024

the output format of some data types are different between Presto/Trino and Doris,
especially for complex type such as array, map and struct.
When user migrate from Presto to Doris, they expect the same format so that they
don't need to modify their business code.

This PR mainly changes:

  1. Add a new session variable serde_dialect
    Default is doris, options are presto or trino. If set to presto or trino,
    the output format returned to MySQL client of some datatypes will be changed:

    • Array
      Doris: ["abc", "def", "", null]
      Presto: [abc, def, , NULL]

    • Map
      Doris: {"k1":null, "k2":"v3"}
      Presto: {k1=NULL, k2=v3}

    • Struct
      Doris: {"s_id":100, "s_name":"abc , "", "s_address":null}
      Presto: {s_id=100, s_name=abc , ", s_address=NULL}

  2. Change the output format of struct type

    Remove the space after :

    • Before: {"s_id": 100, "s_name": "abc , "", "s_address": null}
    • After: {"s_id":100, "s_name":"abc , "", "s_address":null}

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

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@@ -397,7 +397,8 @@ void DataTypeMapSerDe::read_column_from_arrow(IColumn& column, const arrow::Arra
template <bool is_binary_format>
Status DataTypeMapSerDe::_write_column_to_mysql(const IColumn& column,
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: function '_write_column_to_mysql' has cognitive complexity of 84 (threshold 50) [readability-function-cognitive-complexity]

Status DataTypeMapSerDe::_write_column_to_mysql(const IColumn& column,
                         ^
Additional context

be/src/vec/data_types/serde/data_type_map_serde.cpp:409: +1, including nesting penalty of 0, nesting level increased to 1

    if (0 != result.push_string("{", 1)) {
    ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:413: +1, including nesting penalty of 0, nesting level increased to 1

    for (auto j = offsets[col_index - 1]; j < offsets[col_index]; ++j) {
    ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:414: +2, including nesting penalty of 1, nesting level increased to 2

        if (j != offsets[col_index - 1]) {
        ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:415: +3, including nesting penalty of 2, nesting level increased to 3

            if (0 != result.push_string(", ", 2)) {
            ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:419: +2, including nesting penalty of 1, nesting level increased to 2

        if (nested_keys_column.is_null_at(j)) {
        ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:420: +3, including nesting penalty of 2, nesting level increased to 3

            if (0 != result.push_string(serde_info.null_format, serde_info.null_len)) {
            ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:423: +1, nesting level increased to 2

        } else {
          ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:424: +3, including nesting penalty of 2, nesting level increased to 3

            if (is_key_string && serde_info.wrapper_len > 0) {
            ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:424: +1

            if (is_key_string && serde_info.wrapper_len > 0) {
                              ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:425: +4, including nesting penalty of 3, nesting level increased to 4

                if (0 !=
                ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:429: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(key_serde->write_column_to_mysql(nested_keys_column, result, j,
                ^

be/src/common/status.h:626: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:429: +5, including nesting penalty of 4, nesting level increased to 5

                RETURN_IF_ERROR(key_serde->write_column_to_mysql(nested_keys_column, result, j,
                ^

be/src/common/status.h:628: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:431: +4, including nesting penalty of 3, nesting level increased to 4

                if (0 !=
                ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:435: +1, nesting level increased to 3

            } else {
              ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:436: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(key_serde->write_column_to_mysql(nested_keys_column, result, j,
                ^

be/src/common/status.h:626: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:436: +5, including nesting penalty of 4, nesting level increased to 5

                RETURN_IF_ERROR(key_serde->write_column_to_mysql(nested_keys_column, result, j,
                ^

be/src/common/status.h:628: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:440: +2, including nesting penalty of 1, nesting level increased to 2

        if (0 != result.push_string(serde_info.mapkey_delim, serde_info.delim_len)) {
        ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:443: +2, including nesting penalty of 1, nesting level increased to 2

        if (nested_values_column.is_null_at(j)) {
        ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:444: +3, including nesting penalty of 2, nesting level increased to 3

            if (0 != result.push_string(serde_info.null_format, serde_info.null_len)) {
            ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:447: +1, nesting level increased to 2

        } else {
          ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:448: +3, including nesting penalty of 2, nesting level increased to 3

            if (is_val_string && serde_info.wrapper_len > 0) {
            ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:448: +1

            if (is_val_string && serde_info.wrapper_len > 0) {
                              ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:449: +4, including nesting penalty of 3, nesting level increased to 4

                if (0 !=
                ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:453: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(value_serde->write_column_to_mysql(nested_values_column, result, j,
                ^

be/src/common/status.h:626: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:453: +5, including nesting penalty of 4, nesting level increased to 5

                RETURN_IF_ERROR(value_serde->write_column_to_mysql(nested_values_column, result, j,
                ^

be/src/common/status.h:628: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:455: +4, including nesting penalty of 3, nesting level increased to 4

                if (0 !=
                ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:459: +1, nesting level increased to 3

            } else {
              ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:460: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(value_serde->write_column_to_mysql(nested_values_column, result, j,
                ^

be/src/common/status.h:626: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:460: +5, including nesting penalty of 4, nesting level increased to 5

                RETURN_IF_ERROR(value_serde->write_column_to_mysql(nested_values_column, result, j,
                ^

be/src/common/status.h:628: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:465: +1, including nesting penalty of 0, nesting level increased to 1

    if (0 != result.push_string("}", 1)) {
    ^

default:
return Statsu::InternalError("unknown serde dialect: {}", serde_dialect);
}
return Status::OK();
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: function 'write' exceeds recommended size/complexity thresholds [readability-function-size]

Status VMysqlResultWriter<is_binary_format>::write(RuntimeState* state, Block& input_block) {
                                             ^
Additional context

be/src/vec/sink/vmysql_result_writer.cpp:135: 107 lines including whitespace and comments (threshold 80)

Status VMysqlResultWriter<is_binary_format>::write(RuntimeState* state, Block& input_block) {
                                             ^

@morningman
Copy link
Contributor Author

run buildall

@morningman morningman marked this pull request as ready for review June 30, 2024 14:42
@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17785	4674	4422	4422
q2	2647	205	209	205
q3	11433	1201	1148	1148
q4	10423	800	784	784
q5	8011	2739	2833	2739
q6	226	146	146	146
q7	975	618	621	618
q8	9356	2085	2071	2071
q9	8768	6496	6502	6496
q10	8976	3722	3687	3687
q11	464	254	243	243
q12	403	247	232	232
q13	17776	2968	3023	2968
q14	278	234	232	232
q15	526	486	492	486
q16	531	390	379	379
q17	982	660	764	660
q18	8141	7449	7351	7351
q19	5316	1567	1472	1472
q20	690	337	345	337
q21	5010	3097	3997	3097
q22	411	353	348	348
Total cold run time: 119128 ms
Total hot run time: 40121 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4399	4261	4214	4214
q2	381	262	275	262
q3	3014	2691	2758	2691
q4	1925	1636	1571	1571
q5	5236	5328	5287	5287
q6	218	132	132	132
q7	2117	1760	1688	1688
q8	3218	3313	3405	3313
q9	8309	8354	8346	8346
q10	3900	3638	3690	3638
q11	613	483	486	483
q12	774	638	628	628
q13	17579	2993	3035	2993
q14	299	257	272	257
q15	511	487	488	487
q16	482	409	415	409
q17	1763	1482	1479	1479
q18	7582	7549	7281	7281
q19	1687	1429	1492	1429
q20	1956	1768	1775	1768
q21	4808	4779	4723	4723
q22	619	542	522	522
Total cold run time: 71390 ms
Total hot run time: 53601 ms

@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17762	4511	4457	4457
q2	2592	202	205	202
q3	12137	1227	1139	1139
q4	10550	808	806	806
q5	8548	2748	2687	2687
q6	230	147	141	141
q7	971	596	598	596
q8	9232	2106	2079	2079
q9	9205	6546	6505	6505
q10	9065	3747	3726	3726
q11	477	239	239	239
q12	446	243	235	235
q13	19062	3009	2980	2980
q14	258	231	218	218
q15	529	488	495	488
q16	523	377	377	377
q17	987	697	707	697
q18	8087	7528	7482	7482
q19	1719	1573	1393	1393
q20	654	315	319	315
q21	4968	3196	4042	3196
q22	405	344	337	337
Total cold run time: 118407 ms
Total hot run time: 40295 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4267	4321	4245	4245
q2	362	278	263	263
q3	2984	2719	2763	2719
q4	1907	1615	1625	1615
q5	5246	5305	5307	5305
q6	219	129	129	129
q7	2117	1761	1778	1761
q8	3235	3377	3340	3340
q9	8360	8481	8314	8314
q10	3913	3656	3632	3632
q11	587	509	492	492
q12	813	602	599	599
q13	17573	2983	2997	2983
q14	290	266	256	256
q15	528	491	478	478
q16	455	414	429	414
q17	1802	1511	1498	1498
q18	7575	7461	7343	7343
q19	1687	1683	1631	1631
q20	1978	1779	1797	1779
q21	4888	4757	4743	4743
q22	653	544	544	544
Total cold run time: 71439 ms
Total hot run time: 54083 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 173447 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 35e30f339a4fe51e1b94808c9a26c6e951fa0646, data reload: false

query1	917	384	375	375
query2	6464	2399	2268	2268
query3	6658	231	224	224
query4	19182	17320	17448	17320
query5	4203	476	485	476
query6	259	172	168	168
query7	4604	302	294	294
query8	309	283	305	283
query9	8534	2467	2457	2457
query10	618	302	280	280
query11	10524	10088	10017	10017
query12	130	86	82	82
query13	1649	376	376	376
query14	10435	7633	7396	7396
query15	252	192	186	186
query16	8007	283	278	278
query17	1871	546	524	524
query18	2037	265	266	265
query19	201	152	149	149
query20	90	80	84	80
query21	213	137	132	132
query22	4360	4142	3982	3982
query23	33918	33095	33159	33095
query24	11889	2795	2875	2795
query25	651	359	361	359
query26	1768	156	151	151
query27	3040	316	322	316
query28	7529	2114	2110	2110
query29	1044	657	591	591
query30	270	153	147	147
query31	962	725	750	725
query32	93	58	53	53
query33	764	296	284	284
query34	969	454	474	454
query35	752	633	597	597
query36	1120	936	904	904
query37	286	78	75	75
query38	2858	2737	2746	2737
query39	867	785	792	785
query40	284	122	125	122
query41	54	53	53	53
query42	117	103	101	101
query43	574	549	555	549
query44	1173	738	739	738
query45	209	164	164	164
query46	1076	735	754	735
query47	1845	1761	1752	1752
query48	368	323	295	295
query49	1193	418	406	406
query50	766	383	389	383
query51	6852	6800	6750	6750
query52	110	95	97	95
query53	382	292	285	285
query54	1026	445	448	445
query55	75	74	75	74
query56	298	262	267	262
query57	1162	1045	1077	1045
query58	253	241	240	240
query59	3348	3176	3206	3176
query60	298	269	267	267
query61	91	124	90	90
query62	659	481	465	465
query63	318	290	289	289
query64	9853	2219	1737	1737
query65	3173	3095	3073	3073
query66	1390	344	338	338
query67	15564	15099	15228	15099
query68	4625	549	547	547
query69	522	305	297	297
query70	1186	1107	1158	1107
query71	372	286	277	277
query72	7153	5460	5515	5460
query73	749	327	323	323
query74	6001	5466	5466	5466
query75	3412	2651	2686	2651
query76	2756	905	946	905
query77	437	303	304	303
query78	10343	9851	9625	9625
query79	2381	519	531	519
query80	1007	462	478	462
query81	580	221	225	221
query82	741	106	108	106
query83	243	173	171	171
query84	236	88	87	87
query85	2015	278	268	268
query86	498	326	302	302
query87	3299	3047	3084	3047
query88	4171	2400	2398	2398
query89	550	391	379	379
query90	1847	198	195	195
query91	127	102	98	98
query92	65	49	49	49
query93	2297	516	509	509
query94	1244	190	190	190
query95	411	319	316	316
query96	605	276	279	276
query97	3247	3057	3087	3057
query98	213	199	194	194
query99	1167	832	824	824
Total cold run time: 277308 ms
Total hot run time: 173447 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.08	0.04	0.04
query3	0.23	0.05	0.05
query4	1.66	0.09	0.08
query5	0.51	0.48	0.48
query6	1.14	0.73	0.73
query7	0.02	0.02	0.01
query8	0.06	0.04	0.04
query9	0.56	0.51	0.50
query10	0.55	0.53	0.56
query11	0.16	0.12	0.11
query12	0.15	0.12	0.12
query13	0.59	0.58	0.60
query14	0.77	0.77	0.78
query15	0.85	0.81	0.82
query16	0.35	0.35	0.36
query17	0.99	0.95	0.99
query18	0.23	0.23	0.25
query19	1.79	1.68	1.71
query20	0.01	0.02	0.01
query21	15.44	0.79	0.66
query22	4.08	7.39	2.42
query23	18.32	1.37	1.26
query24	2.06	0.23	0.23
query25	0.14	0.09	0.08
query26	0.26	0.18	0.18
query27	0.07	0.08	0.07
query28	13.26	1.01	0.99
query29	12.60	3.28	3.27
query30	0.25	0.05	0.05
query31	2.86	0.39	0.40
query32	3.28	0.47	0.49
query33	2.83	2.96	2.88
query34	17.09	4.42	4.42
query35	4.48	4.61	4.48
query36	0.64	0.49	0.47
query37	0.18	0.15	0.15
query38	0.16	0.15	0.14
query39	0.05	0.04	0.04
query40	0.18	0.14	0.14
query41	0.10	0.05	0.05
query42	0.06	0.06	0.05
query43	0.04	0.04	0.05
Total cold run time: 109.17 s
Total hot run time: 31.03 s

@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	18648	6592	4289	4289
q2	2025	206	195	195
q3	10606	1142	1158	1142
q4	10449	774	728	728
q5	7509	2672	2617	2617
q6	223	133	134	133
q7	944	595	610	595
q8	9251	2060	2074	2060
q9	8845	6492	6480	6480
q10	9033	3672	3745	3672
q11	435	239	230	230
q12	474	230	231	230
q13	17867	2989	2956	2956
q14	270	216	220	216
q15	529	480	470	470
q16	516	369	369	369
q17	972	618	704	618
q18	8054	7400	7353	7353
q19	5830	1545	1436	1436
q20	658	325	331	325
q21	5015	3196	3258	3196
q22	394	335	340	335
Total cold run time: 118547 ms
Total hot run time: 39645 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4377	4229	4242	4229
q2	368	273	262	262
q3	3087	2908	2950	2908
q4	1925	1697	1784	1697
q5	5516	5480	5472	5472
q6	226	131	141	131
q7	2243	1845	1865	1845
q8	3299	3429	3400	3400
q9	8688	8687	8794	8687
q10	4135	3772	3817	3772
q11	610	520	504	504
q12	840	641	646	641
q13	16435	3158	3205	3158
q14	319	286	283	283
q15	527	484	478	478
q16	511	458	441	441
q17	1830	1524	1495	1495
q18	8096	7913	7782	7782
q19	1818	1547	1595	1547
q20	2219	1879	1871	1871
q21	7863	4882	4866	4866
q22	656	567	596	567
Total cold run time: 75588 ms
Total hot run time: 56036 ms

@doris-robot
Copy link

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

query1	921	398	374	374
query2	6441	2356	2359	2356
query3	6636	215	220	215
query4	18737	17591	17463	17463
query5	3668	472	491	472
query6	274	170	190	170
query7	4597	295	288	288
query8	308	296	292	292
query9	8499	2499	2460	2460
query10	570	313	283	283
query11	10744	10032	10136	10032
query12	119	87	82	82
query13	1628	360	357	357
query14	9446	6905	7638	6905
query15	238	184	190	184
query16	7750	267	265	265
query17	1639	549	516	516
query18	1919	268	272	268
query19	192	149	147	147
query20	88	80	81	80
query21	211	126	118	118
query22	4406	4045	4214	4045
query23	33718	33547	33511	33511
query24	10566	2870	2843	2843
query25	622	414	395	395
query26	710	157	159	157
query27	2345	330	322	322
query28	5927	2215	2181	2181
query29	911	687	614	614
query30	266	170	168	168
query31	1003	790	756	756
query32	99	53	53	53
query33	670	293	292	292
query34	889	482	504	482
query35	755	655	640	640
query36	1132	989	973	973
query37	140	80	76	76
query38	3036	2881	2843	2843
query39	878	842	844	842
query40	204	130	125	125
query41	56	51	52	51
query42	107	116	109	109
query43	614	562	559	559
query44	1062	742	752	742
query45	189	162	160	160
query46	1071	707	713	707
query47	1853	1785	1741	1741
query48	374	298	299	298
query49	843	413	420	413
query50	769	383	386	383
query51	6929	6826	6740	6740
query52	100	90	95	90
query53	361	284	283	283
query54	874	446	440	440
query55	79	74	74	74
query56	291	273	263	263
query57	1156	1088	1061	1061
query58	266	244	240	240
query59	3417	3206	2982	2982
query60	305	275	279	275
query61	96	94	95	94
query62	600	461	429	429
query63	321	285	284	284
query64	8548	2268	1805	1805
query65	3159	3086	3094	3086
query66	755	331	338	331
query67	15539	14919	15001	14919
query68	4586	540	536	536
query69	553	425	326	326
query70	1198	1141	1124	1124
query71	372	278	272	272
query72	7080	5586	6084	5586
query73	745	328	324	324
query74	5911	5541	5415	5415
query75	3364	2653	2680	2653
query76	2191	1000	917	917
query77	472	302	290	290
query78	10337	9804	9870	9804
query79	2541	527	515	515
query80	1989	460	466	460
query81	595	221	219	219
query82	741	103	105	103
query83	287	196	181	181
query84	260	90	89	89
query85	1763	294	300	294
query86	469	303	293	293
query87	3293	3097	3086	3086
query88	4258	2376	2377	2376
query89	480	375	386	375
query90	1749	185	183	183
query91	129	100	112	100
query92	56	47	49	47
query93	2226	514	510	510
query94	1169	184	182	182
query95	397	316	316	316
query96	589	264	267	264
query97	3225	3059	3099	3059
query98	222	202	195	195
query99	1346	857	845	845
Total cold run time: 267229 ms
Total hot run time: 174143 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 30.45 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit b3fd9df7b3a1f4e3b0bd7a5394ed6e385e8f82a2, 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.08	0.08
query5	0.50	0.49	0.51
query6	1.13	0.72	0.73
query7	0.02	0.01	0.02
query8	0.06	0.05	0.04
query9	0.55	0.50	0.50
query10	0.55	0.55	0.54
query11	0.15	0.11	0.11
query12	0.14	0.12	0.12
query13	0.61	0.59	0.58
query14	0.75	0.77	0.76
query15	0.86	0.81	0.81
query16	0.36	0.37	0.36
query17	1.02	1.02	1.06
query18	0.22	0.22	0.26
query19	1.87	1.72	1.73
query20	0.01	0.01	0.01
query21	15.42	0.74	0.66
query22	3.63	8.38	1.76
query23	18.20	1.44	1.25
query24	2.10	0.22	0.24
query25	0.15	0.08	0.09
query26	0.27	0.18	0.17
query27	0.08	0.08	0.09
query28	13.22	1.00	1.00
query29	12.59	3.29	3.28
query30	0.25	0.07	0.06
query31	2.86	0.39	0.39
query32	3.29	0.47	0.47
query33	2.95	2.89	2.91
query34	17.01	4.41	4.47
query35	4.48	4.47	4.47
query36	0.66	0.47	0.45
query37	0.18	0.16	0.15
query38	0.15	0.14	0.14
query39	0.04	0.03	0.04
query40	0.17	0.15	0.15
query41	0.09	0.05	0.05
query42	0.06	0.04	0.05
query43	0.04	0.04	0.04
Total cold run time: 108.72 s
Total hot run time: 30.45 s

@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	18463	6020	4393	4393
q2	2506	209	198	198
q3	12138	1182	1211	1182
q4	11405	783	754	754
q5	7740	2725	2688	2688
q6	218	135	134	134
q7	955	592	605	592
q8	9207	2080	2073	2073
q9	8832	6502	6534	6502
q10	8816	3701	3673	3673
q11	453	238	239	238
q12	398	235	226	226
q13	17781	2962	3018	2962
q14	282	223	230	223
q15	522	473	494	473
q16	489	369	374	369
q17	971	696	628	628
q18	7907	7398	7410	7398
q19	5904	1524	1430	1430
q20	652	324	334	324
q21	5012	3161	3858	3161
q22	409	353	349	349
Total cold run time: 121060 ms
Total hot run time: 39970 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4346	4327	4244	4244
q2	361	271	254	254
q3	2999	2690	2743	2690
q4	1889	1625	1560	1560
q5	5248	5280	5273	5273
q6	221	128	129	128
q7	2182	1754	1748	1748
q8	3189	3351	3284	3284
q9	8369	8377	8371	8371
q10	3860	3638	3637	3637
q11	571	479	482	479
q12	788	633	603	603
q13	17614	2991	2998	2991
q14	283	274	270	270
q15	514	484	482	482
q16	465	415	417	415
q17	1794	1485	1466	1466
q18	7736	7543	7406	7406
q19	1692	1627	1615	1615
q20	1983	1801	1773	1773
q21	8350	4630	4607	4607
q22	628	581	544	544
Total cold run time: 75082 ms
Total hot run time: 53840 ms

@doris-robot
Copy link

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

query1	922	391	379	379
query2	6441	2431	2331	2331
query3	6663	217	217	217
query4	18739	17268	17140	17140
query5	4189	475	493	475
query6	281	175	166	166
query7	4603	295	296	295
query8	335	305	313	305
query9	8646	2460	2467	2460
query10	604	301	292	292
query11	11142	10150	10018	10018
query12	139	89	83	83
query13	1671	375	380	375
query14	9550	7570	7611	7570
query15	256	183	182	182
query16	8071	280	273	273
query17	1877	591	550	550
query18	2080	279	273	273
query19	200	154	157	154
query20	91	82	80	80
query21	212	138	122	122
query22	4543	4162	4011	4011
query23	33815	33181	33109	33109
query24	11113	2847	2837	2837
query25	628	356	361	356
query26	1197	152	149	149
query27	2928	306	312	306
query28	7670	2110	2101	2101
query29	874	619	598	598
query30	288	154	152	152
query31	955	732	752	732
query32	99	51	53	51
query33	762	288	277	277
query34	968	463	467	463
query35	737	598	597	597
query36	1076	923	929	923
query37	152	73	73	73
query38	2883	2751	2756	2751
query39	839	773	777	773
query40	202	123	119	119
query41	59	50	51	50
query42	119	98	103	98
query43	597	589	544	544
query44	1184	736	727	727
query45	189	165	167	165
query46	1083	694	727	694
query47	1875	1753	1772	1753
query48	353	299	303	299
query49	1085	412	411	411
query50	759	382	380	380
query51	7058	6787	6804	6787
query52	103	97	93	93
query53	356	294	286	286
query54	959	446	452	446
query55	75	74	74	74
query56	278	266	261	261
query57	1148	1056	1079	1056
query58	265	246	252	246
query59	3309	3189	3058	3058
query60	305	276	268	268
query61	94	89	107	89
query62	668	459	452	452
query63	316	289	280	280
query64	8957	2238	1784	1784
query65	3165	3099	3116	3099
query66	1085	338	339	338
query67	15470	15010	15000	15000
query68	4615	550	559	550
query69	546	379	321	321
query70	1152	1090	1155	1090
query71	413	273	282	273
query72	7220	5202	4621	4621
query73	754	331	325	325
query74	5827	5506	5545	5506
query75	3460	2690	2662	2662
query76	2925	930	978	930
query77	575	310	298	298
query78	10553	9883	9727	9727
query79	2404	540	533	533
query80	1840	464	466	464
query81	601	227	224	224
query82	915	104	102	102
query83	331	228	169	169
query84	282	84	85	84
query85	1883	284	275	275
query86	474	340	314	314
query87	3291	3098	3130	3098
query88	3968	2375	2378	2375
query89	489	387	393	387
query90	1852	188	191	188
query91	126	99	99	99
query92	59	50	48	48
query93	2544	514	519	514
query94	1240	185	189	185
query95	400	314	321	314
query96	589	272	274	272
query97	3255	3035	3079	3035
query98	217	197	193	193
query99	1257	871	861	861
Total cold run time: 275412 ms
Total hot run time: 172893 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.04
query2	0.08	0.04	0.04
query3	0.23	0.05	0.05
query4	1.68	0.07	0.07
query5	0.49	0.48	0.46
query6	1.14	0.72	0.71
query7	0.02	0.02	0.02
query8	0.05	0.05	0.04
query9	0.57	0.50	0.50
query10	0.55	0.54	0.54
query11	0.15	0.12	0.11
query12	0.15	0.13	0.12
query13	0.60	0.58	0.59
query14	0.79	0.77	0.77
query15	0.84	0.80	0.81
query16	0.37	0.36	0.36
query17	1.02	0.96	1.01
query18	0.22	0.24	0.24
query19	1.76	1.77	1.73
query20	0.01	0.00	0.01
query21	15.46	0.77	0.67
query22	3.98	7.97	1.67
query23	18.29	1.35	1.31
query24	2.06	0.24	0.22
query25	0.15	0.08	0.08
query26	0.28	0.18	0.18
query27	0.08	0.08	0.08
query28	13.21	1.02	1.01
query29	12.62	3.37	3.30
query30	0.25	0.07	0.05
query31	2.88	0.37	0.38
query32	3.29	0.48	0.46
query33	2.91	2.83	2.93
query34	17.12	4.39	4.37
query35	4.52	4.41	4.44
query36	0.65	0.46	0.47
query37	0.17	0.15	0.16
query38	0.15	0.14	0.14
query39	0.04	0.04	0.03
query40	0.16	0.13	0.15
query41	0.09	0.05	0.05
query42	0.06	0.06	0.04
query43	0.04	0.04	0.03
Total cold run time: 109.22 s
Total hot run time: 30.17 s


// The description of serde format.
// Used for the string format of result return to MySQL client.
struct SerdeInfo {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe this struct can put into DataTypeSerDe.FormatOptions.mysql.serdeInfo ?

Copy link
Contributor

Choose a reason for hiding this comment

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

and we have some option definition can be reuse ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right..

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@@ -397,7 +397,8 @@ void DataTypeMapSerDe::read_column_from_arrow(IColumn& column, const arrow::Arra
template <bool is_binary_format>
Status DataTypeMapSerDe::_write_column_to_mysql(const IColumn& column,
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: function '_write_column_to_mysql' has cognitive complexity of 84 (threshold 50) [readability-function-cognitive-complexity]

Status DataTypeMapSerDe::_write_column_to_mysql(const IColumn& column,
                         ^
Additional context

be/src/vec/data_types/serde/data_type_map_serde.cpp:409: +1, including nesting penalty of 0, nesting level increased to 1

    if (0 != result.push_string("{", 1)) {
    ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:413: +1, including nesting penalty of 0, nesting level increased to 1

    for (auto j = offsets[col_index - 1]; j < offsets[col_index]; ++j) {
    ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:414: +2, including nesting penalty of 1, nesting level increased to 2

        if (j != offsets[col_index - 1]) {
        ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:415: +3, including nesting penalty of 2, nesting level increased to 3

            if (0 != result.push_string(", ", 2)) {
            ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:419: +2, including nesting penalty of 1, nesting level increased to 2

        if (nested_keys_column.is_null_at(j)) {
        ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:420: +3, including nesting penalty of 2, nesting level increased to 3

            if (0 != result.push_string(options.null_format, options.null_len)) {
            ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:423: +1, nesting level increased to 2

        } else {
          ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:424: +3, including nesting penalty of 2, nesting level increased to 3

            if (is_key_string && options.wrapper_len > 0) {
            ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:424: +1

            if (is_key_string && options.wrapper_len > 0) {
                              ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:425: +4, including nesting penalty of 3, nesting level increased to 4

                if (0 != result.push_string(options.nested_string_wrapper, options.wrapper_len)) {
                ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:428: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(key_serde->write_column_to_mysql(nested_keys_column, result, j,
                ^

be/src/common/status.h:626: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:428: +5, including nesting penalty of 4, nesting level increased to 5

                RETURN_IF_ERROR(key_serde->write_column_to_mysql(nested_keys_column, result, j,
                ^

be/src/common/status.h:628: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:430: +4, including nesting penalty of 3, nesting level increased to 4

                if (0 != result.push_string(options.nested_string_wrapper, options.wrapper_len)) {
                ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:433: +1, nesting level increased to 3

            } else {
              ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:434: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(key_serde->write_column_to_mysql(nested_keys_column, result, j,
                ^

be/src/common/status.h:626: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:434: +5, including nesting penalty of 4, nesting level increased to 5

                RETURN_IF_ERROR(key_serde->write_column_to_mysql(nested_keys_column, result, j,
                ^

be/src/common/status.h:628: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:438: +2, including nesting penalty of 1, nesting level increased to 2

        if (0 != result.push_string(&options.map_key_delim, 1)) {
        ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:441: +2, including nesting penalty of 1, nesting level increased to 2

        if (nested_values_column.is_null_at(j)) {
        ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:442: +3, including nesting penalty of 2, nesting level increased to 3

            if (0 != result.push_string(options.null_format, options.null_len)) {
            ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:445: +1, nesting level increased to 2

        } else {
          ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:446: +3, including nesting penalty of 2, nesting level increased to 3

            if (is_val_string && options.wrapper_len > 0) {
            ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:446: +1

            if (is_val_string && options.wrapper_len > 0) {
                              ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:447: +4, including nesting penalty of 3, nesting level increased to 4

                if (0 != result.push_string(options.nested_string_wrapper, options.wrapper_len)) {
                ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:450: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(value_serde->write_column_to_mysql(nested_values_column, result, j,
                ^

be/src/common/status.h:626: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:450: +5, including nesting penalty of 4, nesting level increased to 5

                RETURN_IF_ERROR(value_serde->write_column_to_mysql(nested_values_column, result, j,
                ^

be/src/common/status.h:628: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:452: +4, including nesting penalty of 3, nesting level increased to 4

                if (0 != result.push_string(options.nested_string_wrapper, options.wrapper_len)) {
                ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:455: +1, nesting level increased to 3

            } else {
              ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:456: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(value_serde->write_column_to_mysql(nested_values_column, result, j,
                ^

be/src/common/status.h:626: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:456: +5, including nesting penalty of 4, nesting level increased to 5

                RETURN_IF_ERROR(value_serde->write_column_to_mysql(nested_values_column, result, j,
                ^

be/src/common/status.h:628: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/vec/data_types/serde/data_type_map_serde.cpp:461: +1, including nesting penalty of 0, nesting level increased to 1

    if (0 != result.push_string("}", 1)) {
    ^

@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17952	4871	4263	4263
q2	2028	194	193	193
q3	10530	1234	1098	1098
q4	10217	873	802	802
q5	7502	2691	2603	2603
q6	220	137	140	137
q7	960	624	623	623
q8	9237	2090	2069	2069
q9	8719	6523	6474	6474
q10	8968	3724	3715	3715
q11	460	244	248	244
q12	406	243	234	234
q13	18040	2980	2990	2980
q14	276	224	218	218
q15	520	502	502	502
q16	521	378	385	378
q17	979	703	663	663
q18	8085	7587	7416	7416
q19	6851	1488	1430	1430
q20	659	333	325	325
q21	4908	3920	4046	3920
q22	421	348	346	346
Total cold run time: 118459 ms
Total hot run time: 40633 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4384	4229	4278	4229
q2	366	264	263	263
q3	3127	2894	2892	2892
q4	1964	1814	1771	1771
q5	5515	5517	5441	5441
q6	233	135	139	135
q7	2290	1863	1815	1815
q8	3259	3437	3441	3437
q9	8753	8746	8799	8746
q10	4232	3700	3806	3700
q11	600	491	505	491
q12	824	665	638	638
q13	17028	3180	3203	3180
q14	321	274	275	274
q15	536	489	506	489
q16	484	454	435	435
q17	1826	1543	1521	1521
q18	8158	7971	7903	7903
q19	1792	1573	1776	1573
q20	2114	1891	1869	1869
q21	5112	4818	4856	4818
q22	648	570	587	570
Total cold run time: 73566 ms
Total hot run time: 56190 ms

@doris-robot
Copy link

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

query1	912	388	381	381
query2	6473	2528	2249	2249
query3	6634	208	215	208
query4	18913	17652	17268	17268
query5	3638	474	475	474
query6	253	170	160	160
query7	4582	314	288	288
query8	312	273	283	273
query9	8621	2447	2439	2439
query10	572	281	276	276
query11	10389	9927	10031	9927
query12	112	85	83	83
query13	1644	370	360	360
query14	9291	6398	7519	6398
query15	226	190	189	189
query16	7771	265	266	265
query17	1730	530	513	513
query18	1950	275	263	263
query19	194	146	160	146
query20	102	83	80	80
query21	205	133	128	128
query22	4385	4068	3966	3966
query23	33924	33554	33673	33554
query24	11314	2987	2834	2834
query25	584	387	372	372
query26	727	156	152	152
query27	2333	353	326	326
query28	5953	2191	2171	2171
query29	869	654	620	620
query30	254	164	161	161
query31	981	763	749	749
query32	100	53	58	53
query33	775	297	287	287
query34	1091	491	498	491
query35	739	647	651	647
query36	1129	1008	966	966
query37	139	77	82	77
query38	2986	2881	2824	2824
query39	867	821	834	821
query40	204	132	133	132
query41	53	54	52	52
query42	118	96	102	96
query43	581	528	528	528
query44	1301	743	725	725
query45	192	164	167	164
query46	1087	726	726	726
query47	1848	1743	1764	1743
query48	375	300	289	289
query49	852	410	407	407
query50	790	386	387	386
query51	6947	6785	6716	6716
query52	99	93	93	93
query53	360	287	292	287
query54	878	460	440	440
query55	74	74	72	72
query56	290	256	261	256
query57	1092	1057	1055	1055
query58	270	238	287	238
query59	3269	3092	3220	3092
query60	309	272	270	270
query61	95	96	89	89
query62	593	440	426	426
query63	324	294	291	291
query64	8530	2295	1845	1845
query65	3164	3108	3088	3088
query66	750	327	334	327
query67	15627	15209	15044	15044
query68	4479	549	553	549
query69	467	326	315	315
query70	1108	1093	1121	1093
query71	371	284	342	284
query72	7020	5231	5608	5231
query73	739	324	330	324
query74	5916	5510	5477	5477
query75	3367	2633	2645	2633
query76	2111	968	881	881
query77	434	295	300	295
query78	10325	9843	9811	9811
query79	2722	515	526	515
query80	2318	465	481	465
query81	579	227	218	218
query82	787	111	104	104
query83	272	166	177	166
query84	279	87	91	87
query85	1929	279	275	275
query86	480	329	281	281
query87	3281	3084	3116	3084
query88	4011	2462	2436	2436
query89	470	376	382	376
query90	1735	189	187	187
query91	126	148	102	102
query92	60	48	49	48
query93	2598	522	516	516
query94	1102	187	191	187
query95	406	317	323	317
query96	585	278	271	271
query97	3172	3031	3032	3031
query98	217	199	197	197
query99	1336	877	855	855
Total cold run time: 268548 ms
Total hot run time: 172927 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.04
query2	0.07	0.04	0.04
query3	0.23	0.06	0.06
query4	1.66	0.08	0.08
query5	0.51	0.49	0.52
query6	1.13	0.73	0.73
query7	0.02	0.02	0.01
query8	0.05	0.04	0.04
query9	0.55	0.49	0.50
query10	0.54	0.54	0.56
query11	0.16	0.11	0.11
query12	0.14	0.12	0.12
query13	0.59	0.58	0.57
query14	0.76	0.79	0.79
query15	0.85	0.82	0.80
query16	0.35	0.36	0.37
query17	1.06	1.02	1.04
query18	0.23	0.23	0.24
query19	1.87	1.75	1.81
query20	0.02	0.01	0.01
query21	15.49	0.72	0.64
query22	4.87	6.27	2.33
query23	18.31	1.36	1.27
query24	2.17	0.23	0.21
query25	0.15	0.09	0.09
query26	0.26	0.17	0.18
query27	0.08	0.08	0.08
query28	13.21	1.01	1.00
query29	12.62	3.34	3.33
query30	0.25	0.06	0.05
query31	2.86	0.38	0.39
query32	3.29	0.50	0.47
query33	2.92	2.87	2.92
query34	17.06	4.42	4.45
query35	4.43	4.45	4.42
query36	0.65	0.46	0.49
query37	0.18	0.15	0.16
query38	0.17	0.16	0.15
query39	0.04	0.03	0.04
query40	0.17	0.17	0.15
query41	0.09	0.05	0.04
query42	0.06	0.05	0.05
query43	0.05	0.05	0.04
Total cold run time: 110.21 s
Total hot run time: 31.07 s

@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17711	4497	4511	4497
q2	2027	196	193	193
q3	10526	1237	1080	1080
q4	10205	796	817	796
q5	7493	2664	2716	2664
q6	225	138	140	138
q7	953	607	603	603
q8	9257	2106	2071	2071
q9	9022	6506	6505	6505
q10	9059	3705	3703	3703
q11	452	250	249	249
q12	475	233	234	233
q13	17771	2991	3049	2991
q14	257	232	226	226
q15	533	493	497	493
q16	530	385	388	385
q17	975	716	783	716
q18	8154	7553	7437	7437
q19	6213	1461	1465	1461
q20	664	323	342	323
q21	5099	3931	3994	3931
q22	423	349	348	348
Total cold run time: 118024 ms
Total hot run time: 41043 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4453	4309	4280	4280
q2	371	267	276	267
q3	3158	2913	2913	2913
q4	1993	1765	1807	1765
q5	5558	5473	5438	5438
q6	228	145	138	138
q7	2265	1846	1836	1836
q8	3252	3470	3400	3400
q9	8716	8809	8786	8786
q10	4253	3702	3808	3702
q11	616	505	491	491
q12	830	652	631	631
q13	17197	3252	3196	3196
q14	299	305	273	273
q15	521	504	500	500
q16	480	448	438	438
q17	1836	1498	1507	1498
q18	8254	7928	7885	7885
q19	1858	1569	1631	1569
q20	2903	1908	1869	1869
q21	5143	5092	4927	4927
q22	646	575	601	575
Total cold run time: 74830 ms
Total hot run time: 56377 ms

@doris-robot
Copy link

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

query1	917	386	366	366
query2	6454	2505	2545	2505
query3	6641	206	213	206
query4	19598	17424	17365	17365
query5	3656	487	487	487
query6	269	183	180	180
query7	4595	308	288	288
query8	314	297	298	297
query9	8510	2407	2410	2407
query10	571	290	277	277
query11	10562	10135	9934	9934
query12	112	84	84	84
query13	1638	368	363	363
query14	10168	7561	7031	7031
query15	248	192	188	188
query16	7783	261	254	254
query17	1901	528	511	511
query18	1943	267	269	267
query19	195	147	169	147
query20	88	80	80	80
query21	212	136	123	123
query22	4332	4039	3963	3963
query23	34060	33681	33543	33543
query24	10571	2890	2855	2855
query25	600	392	386	386
query26	713	156	162	156
query27	2272	328	325	325
query28	5936	2123	2110	2110
query29	868	625	638	625
query30	251	155	156	155
query31	985	766	757	757
query32	100	53	52	52
query33	666	286	288	286
query34	868	479	493	479
query35	751	618	618	618
query36	1129	963	987	963
query37	153	87	82	82
query38	2946	2817	2837	2817
query39	915	836	837	836
query40	210	134	129	129
query41	55	56	56	56
query42	106	100	110	100
query43	610	597	579	579
query44	1059	727	737	727
query45	196	167	162	162
query46	1071	703	717	703
query47	1888	1754	1802	1754
query48	364	288	292	288
query49	847	406	419	406
query50	762	374	379	374
query51	6800	6712	6783	6712
query52	106	89	92	89
query53	370	285	288	285
query54	875	445	431	431
query55	72	71	71	71
query56	280	262	266	262
query57	1118	1049	1038	1038
query58	240	244	241	241
query59	3510	3405	3450	3405
query60	301	270	266	266
query61	93	94	89	89
query62	587	442	439	439
query63	330	321	284	284
query64	8540	2245	1719	1719
query65	3198	3079	3112	3079
query66	754	313	326	313
query67	15428	14818	15053	14818
query68	4548	516	527	516
query69	539	356	311	311
query70	1127	1112	1186	1112
query71	357	279	275	275
query72	7720	5160	5356	5160
query73	742	320	316	316
query74	5952	5491	5557	5491
query75	3331	2615	2704	2615
query76	2162	964	891	891
query77	424	298	292	292
query78	10379	9761	9731	9731
query79	1895	510	511	510
query80	2179	464	460	460
query81	592	220	222	220
query82	1028	112	103	103
query83	287	171	240	171
query84	262	85	86	85
query85	1196	272	260	260
query86	454	288	324	288
query87	3304	3151	3094	3094
query88	3054	2338	2311	2311
query89	474	367	372	367
query90	1711	187	184	184
query91	122	102	97	97
query92	55	52	47	47
query93	1946	502	509	502
query94	1117	186	179	179
query95	393	307	305	305
query96	587	269	258	258
query97	3195	2984	3041	2984
query98	225	191	190	190
query99	1196	858	838	838
Total cold run time: 266814 ms
Total hot run time: 173350 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.04
query2	0.08	0.04	0.04
query3	0.24	0.06	0.06
query4	1.65	0.09	0.08
query5	0.49	0.49	0.50
query6	1.14	0.73	0.73
query7	0.02	0.01	0.01
query8	0.05	0.04	0.05
query9	0.55	0.49	0.50
query10	0.54	0.54	0.54
query11	0.15	0.11	0.12
query12	0.14	0.12	0.13
query13	0.59	0.59	0.58
query14	0.77	0.78	0.78
query15	0.86	0.83	0.82
query16	0.35	0.36	0.35
query17	0.95	1.04	0.98
query18	0.22	0.26	0.20
query19	1.85	1.76	1.78
query20	0.01	0.01	0.01
query21	15.41	0.74	0.64
query22	4.40	7.53	1.26
query23	18.35	1.43	1.32
query24	2.10	0.26	0.22
query25	0.16	0.09	0.08
query26	0.26	0.18	0.18
query27	0.08	0.07	0.08
query28	13.20	1.02	0.99
query29	12.63	3.34	3.32
query30	0.26	0.06	0.06
query31	2.87	0.42	0.39
query32	3.22	0.48	0.46
query33	2.90	2.85	2.94
query34	17.09	4.37	4.40
query35	4.46	4.47	4.46
query36	0.65	0.49	0.50
query37	0.18	0.16	0.15
query38	0.15	0.15	0.14
query39	0.04	0.04	0.03
query40	0.17	0.16	0.14
query41	0.09	0.04	0.06
query42	0.06	0.05	0.05
query43	0.04	0.05	0.03
Total cold run time: 109.46 s
Total hot run time: 29.96 s

Copy link
Contributor

github-actions bot commented Jul 3, 2024

PR approved by anyone and no changes requested.

Copy link
Contributor

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

@kaka11chen kaka11chen 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 Jul 3, 2024
Copy link
Contributor

github-actions bot commented Jul 3, 2024

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

@morningman morningman merged commit 0e9bbb9 into apache:master Jul 3, 2024
28 of 31 checks passed
morningman added a commit to morningman/doris that referenced this pull request Jul 3, 2024
the output format of some data types are different between Presto/Trino
and Doris,
especially for complex type such as array, map and struct.
When user migrate from Presto to Doris, they expect the same format so
that they
don't need to modify their business code.

This PR mainly changes:

1. Add a new session variable `serde_dialect`
Default is `doris`, options are `presto` or `trino`. If set to presto or
trino,
the output format returned to MySQL client of some datatypes will be
changed:

    - Array
        Doris: `["abc", "def", "", null]`
        Presto: `[abc, def, , NULL]`

    - Map
        Doris: `{"k1":null, "k2":"v3"}`
        Presto: `{k1=NULL, k2=v3}`

    - Struct
        Doris: `{"s_id":100, "s_name":"abc , "", "s_address":null}`
        Presto: `{s_id=100, s_name=abc , ", s_address=NULL}`

2. Change the output format of struct type

    Remove the space after `:`

    - Before: `{"s_id": 100, "s_name": "abc , "", "s_address": null}`
    - After: ``{"s_id":100, "s_name":"abc , "", "s_address":null}``
zhannngchen pushed a commit that referenced this pull request Jul 4, 2024
#37067 passed all pipeline cases
based on the branch that doesn't contain
#37039 which changed the output
format merged later, causing this case's failure.
dataroaring pushed a commit that referenced this pull request Jul 17, 2024
the output format of some data types are different between Presto/Trino
and Doris,
especially for complex type such as array, map and struct.
When user migrate from Presto to Doris, they expect the same format so
that they
don't need to modify their business code.

This PR mainly changes:

1. Add a new session variable `serde_dialect`
Default is `doris`, options are `presto` or `trino`. If set to presto or
trino,
the output format returned to MySQL client of some datatypes will be
changed:

    - Array
        Doris: `["abc", "def", "", null]`
        Presto: `[abc, def, , NULL]`

    - Map
        Doris: `{"k1":null, "k2":"v3"}`
        Presto: `{k1=NULL, k2=v3}`

    - Struct
        Doris: `{"s_id":100, "s_name":"abc , "", "s_address":null}`
        Presto: `{s_id=100, s_name=abc , ", s_address=NULL}`
 
2. Change the output format of struct type

    Remove the space after `:`

    - Before: `{"s_id": 100, "s_name": "abc , "", "s_address": null}`
    - After: ``{"s_id":100, "s_name":"abc , "", "s_address":null}``
dataroaring pushed a commit that referenced this pull request Jul 17, 2024
#37067 passed all pipeline cases
based on the branch that doesn't contain
#37039 which changed the output
format merged later, causing this case's failure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants