Skip to content

Conversation

@seawinde
Copy link
Contributor

@seawinde seawinde commented Jan 15, 2026

What problem does this PR solve?

Fix query err when calc mv fd by catch it and log more detailed info for troubleshoot a problem

  1. originOutputs.size() should equlas targetOutputs.size(), if not would throw exception, this would cause query err,
    should log err log and not cause query err
  2. current log could not find the root cause, so add detail log
  3. fix the problem by mapping the slot full path name between scan mv output and mv sql plan output

for example as following

  CREATE TABLE fact_var (
    k INT,
    v VARIANT
  ) ENGINE=OLAP
  DUPLICATE KEY(k)
  DISTRIBUTED BY HASH(k) BUCKETS 1
  PROPERTIES ("replication_num" = "1");

  INSERT INTO fact_var VALUES
  (1, '{"a":1,"b":{"c":10,"d":20}}'),
  (2, '{"a":2,"b":{"c":30}}');

  CREATE MATERIALIZED VIEW mv_var
        BUILD IMMEDIATE REFRESH COMPLETE ON MANUAL
        DISTRIBUTED BY RANDOM BUCKETS 2
        PROPERTIES ('replication_num' = '1') 
        AS
  SELECT k, v
  FROM fact_var;

if run query as fllowing, mv_var sacn would return k, v, v['a'] but mv_var def plan sql, would return k, v,
the size is different but also can work after the fix

SELECT v['a'] AS c_val FROM mv_var;

Issue Number: close #xxx

Related PR: #40106

Problem Summary:

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@Thearas
Copy link
Contributor

Thearas commented Jan 15, 2026

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?

@seawinde
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17614	4169	5011	4169
q2	2064	373	245	245
q3	10111	1320	706	706
q4	10220	893	314	314
q5	7578	2277	1829	1829
q6	187	172	139	139
q7	921	778	663	663
q8	9269	1357	1101	1101
q9	4878	4727	4629	4629
q10	6770	1794	1419	1419
q11	522	304	289	289
q12	711	745	584	584
q13	17772	3856	3085	3085
q14	292	303	279	279
q15	566	511	508	508
q16	694	674	642	642
q17	650	832	520	520
q18	6853	6478	6471	6471
q19	1246	981	647	647
q20	398	363	242	242
q21	3039	2449	2269	2269
q22	1037	1002	980	980
Total cold run time: 103392 ms
Total hot run time: 31730 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4130	4031	4053	4031
q2	354	388	313	313
q3	2076	2588	2185	2185
q4	1339	1747	1323	1323
q5	4101	4057	3982	3982
q6	207	170	131	131
q7	1822	1832	2065	1832
q8	2645	2462	2458	2458
q9	7138	7248	7108	7108
q10	2741	2739	2318	2318
q11	559	503	523	503
q12	806	745	637	637
q13	3569	4115	3316	3316
q14	314	329	270	270
q15	547	486	495	486
q16	666	703	651	651
q17	1190	1332	1348	1332
q18	8077	7856	7821	7821
q19	946	860	912	860
q20	2032	2104	1967	1967
q21	4839	4450	4385	4385
q22	1187	1120	1034	1034
Total cold run time: 51285 ms
Total hot run time: 48943 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 174122 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 0462473f3dd36c2d0ac938ca0db7f08159f967ec, data reload: false

query5	4392	627	482	482
query6	325	262	209	209
query7	4211	441	252	252
query8	345	250	228	228
query9	8670	2905	2857	2857
query10	531	372	337	337
query11	15284	15198	14823	14823
query12	167	111	108	108
query13	1240	461	361	361
query14	5622	3065	2804	2804
query14_1	2655	2793	2631	2631
query15	205	192	175	175
query16	978	485	468	468
query17	1112	676	586	586
query18	2433	445	342	342
query19	224	224	199	199
query20	132	117	117	117
query21	208	136	126	126
query22	4060	4277	4053	4053
query23	16967	16318	15621	15621
query23_1	15893	15855	15788	15788
query24	7402	1583	1154	1154
query24_1	1165	1178	1163	1163
query25	557	466	414	414
query26	1249	255	146	146
query27	2785	432	278	278
query28	4593	2123	2102	2102
query29	758	543	443	443
query30	304	245	203	203
query31	793	620	557	557
query32	79	71	70	70
query33	516	386	293	293
query34	921	870	524	524
query35	709	771	676	676
query36	928	899	822	822
query37	133	90	77	77
query38	2697	2662	2587	2587
query39	769	778	713	713
query39_1	709	727	704	704
query40	217	134	115	115
query41	63	61	60	60
query42	98	98	95	95
query43	447	450	414	414
query44	1288	727	724	724
query45	182	180	173	173
query46	831	944	567	567
query47	1410	1441	1373	1373
query48	308	314	241	241
query49	595	410	323	323
query50	629	266	196	196
query51	3773	3824	3789	3789
query52	105	105	95	95
query53	291	321	271	271
query54	283	265	270	265
query55	78	79	75	75
query56	314	302	305	302
query57	1053	1030	897	897
query58	273	288	249	249
query59	2021	2159	2137	2137
query60	321	329	315	315
query61	161	154	154	154
query62	389	365	308	308
query63	291	264	263	263
query64	4859	1269	955	955
query65	3816	3763	3589	3589
query66	1458	401	321	321
query67	15564	15669	15300	15300
query68	2430	1073	738	738
query69	442	361	320	320
query70	1022	860	933	860
query71	316	309	288	288
query72	5403	3167	3314	3167
query73	589	713	302	302
query74	8762	8703	8669	8669
query75	2713	2825	2435	2435
query76	2279	1042	661	661
query77	361	377	296	296
query78	9725	9867	9131	9131
query79	2531	884	588	588
query80	1741	572	501	501
query81	544	264	222	222
query82	984	147	113	113
query83	328	250	242	242
query84	253	112	88	88
query85	932	482	455	455
query86	401	302	279	279
query87	2894	2871	2805	2805
query88	3473	2584	2551	2551
query89	368	340	320	320
query90	2014	169	170	169
query91	176	171	138	138
query92	72	71	67	67
query93	1178	888	527	527
query94	652	332	307	307
query95	585	377	315	315
query96	644	495	224	224
query97	2381	2346	2327	2327
query98	232	198	193	193
query99	602	561	524	524
Total cold run time: 250239 ms
Total hot run time: 174122 ms

@doris-robot
Copy link

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

query1	0.05	0.05	0.05
query2	0.09	0.04	0.05
query3	0.26	0.08	0.09
query4	1.61	0.12	0.11
query5	0.27	0.26	0.26
query6	1.15	0.68	0.65
query7	0.03	0.02	0.02
query8	0.06	0.04	0.04
query9	0.56	0.51	0.49
query10	0.56	0.54	0.55
query11	0.14	0.09	0.10
query12	0.15	0.10	0.11
query13	0.61	0.59	0.59
query14	0.95	0.96	0.93
query15	0.79	0.78	0.79
query16	0.38	0.39	0.40
query17	1.05	1.06	1.04
query18	0.22	0.20	0.21
query19	1.89	1.80	1.89
query20	0.02	0.02	0.01
query21	15.44	0.28	0.13
query22	5.01	0.05	0.05
query23	15.89	0.27	0.10
query24	0.94	0.57	0.58
query25	0.11	0.06	0.06
query26	0.14	0.13	0.14
query27	0.09	0.06	0.07
query28	4.73	1.06	0.88
query29	12.53	3.91	3.19
query30	0.29	0.13	0.12
query31	2.81	0.64	0.39
query32	3.24	0.55	0.46
query33	2.92	2.95	3.03
query34	16.00	5.09	4.41
query35	4.45	4.41	4.40
query36	0.65	0.51	0.49
query37	0.11	0.07	0.07
query38	0.08	0.04	0.04
query39	0.04	0.03	0.03
query40	0.17	0.14	0.12
query41	0.09	0.04	0.03
query42	0.04	0.04	0.03
query43	0.04	0.04	0.04
Total cold run time: 96.65 s
Total hot run time: 26.96 s

@seawinde
Copy link
Contributor Author

run buildall

@seawinde seawinde changed the title [fix](mtmv) Fix query err when calc mv fd by catch it and log more detailed info for troubleshoot a problem [fix](mtmv) Fix query err when calc mv functional dependency which has variant and log more detailed info for troubleshoot a problem Jan 16, 2026
@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17593	4279	4073	4073
q2	2080	377	251	251
q3	10126	1292	775	775
q4	10235	964	325	325
q5	7528	2150	1868	1868
q6	188	167	137	137
q7	919	820	655	655
q8	9271	1609	1135	1135
q9	4914	4638	4662	4638
q10	6728	1850	1416	1416
q11	538	317	295	295
q12	714	774	615	615
q13	17757	3866	3084	3084
q14	302	292	280	280
q15	571	517	517	517
q16	689	689	633	633
q17	696	833	524	524
q18	6721	6600	7060	6600
q19	1172	1076	686	686
q20	432	397	280	280
q21	3342	2704	2538	2538
q22	1145	1061	1057	1057
Total cold run time: 103661 ms
Total hot run time: 32382 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4521	4341	4322	4322
q2	335	424	340	340
q3	2364	2780	2331	2331
q4	1438	1935	1452	1452
q5	4569	4296	4462	4296
q6	228	172	136	136
q7	2119	1911	1823	1823
q8	2637	2438	2541	2438
q9	7120	7492	7044	7044
q10	2637	2850	2301	2301
q11	560	470	470	470
q12	692	737	658	658
q13	3849	4137	3128	3128
q14	268	288	270	270
q15	521	491	486	486
q16	665	667	624	624
q17	1136	1281	1332	1281
q18	7601	7444	7209	7209
q19	911	833	812	812
q20	1898	1998	1864	1864
q21	4614	4295	4127	4127
q22	1115	1031	984	984
Total cold run time: 51798 ms
Total hot run time: 48396 ms

@doris-robot
Copy link

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

query5	4902	617	484	484
query6	332	232	232	232
query7	4234	459	270	270
query8	336	243	251	243
query9	8762	2947	2917	2917
query10	569	389	346	346
query11	15211	15192	14955	14955
query12	203	120	117	117
query13	1257	505	382	382
query14	6615	3052	2794	2794
query14_1	2669	2654	2640	2640
query15	203	195	180	180
query16	1003	483	472	472
query17	1068	675	567	567
query18	2728	437	346	346
query19	222	218	199	199
query20	120	117	115	115
query21	219	140	125	125
query22	3906	4109	3813	3813
query23	16189	15724	15264	15264
query23_1	15535	15503	15411	15411
query24	7127	1564	1191	1191
query24_1	1194	1248	1224	1224
query25	533	443	388	388
query26	1237	273	152	152
query27	2772	462	294	294
query28	4489	2371	2318	2318
query29	756	515	409	409
query30	313	246	206	206
query31	829	633	580	580
query32	83	75	77	75
query33	521	358	309	309
query34	943	876	543	543
query35	734	771	680	680
query36	914	934	858	858
query37	147	97	88	88
query38	2729	2722	2650	2650
query39	788	758	757	757
query39_1	714	720	724	720
query40	224	137	121	121
query41	68	63	62	62
query42	105	106	107	106
query43	467	446	417	417
query44	1339	761	755	755
query45	188	191	178	178
query46	849	942	596	596
query47	1437	1526	1379	1379
query48	340	331	241	241
query49	604	446	377	377
query50	646	273	207	207
query51	3775	3771	3776	3771
query52	117	111	99	99
query53	300	333	270	270
query54	300	275	255	255
query55	85	86	78	78
query56	320	335	336	335
query57	991	1013	942	942
query58	282	271	269	269
query59	2194	2333	2113	2113
query60	346	345	325	325
query61	148	149	149	149
query62	407	389	326	326
query63	303	275	268	268
query64	4854	1274	1008	1008
query65	3922	3785	3797	3785
query66	1400	427	325	325
query67	15669	15629	15524	15524
query68	2378	1158	880	880
query69	473	371	343	343
query70	1085	1017	986	986
query71	339	315	309	309
query72	5306	3278	3230	3230
query73	685	755	339	339
query74	8709	8820	8601	8601
query75	2744	2809	2466	2466
query76	2276	1083	672	672
query77	369	388	328	328
query78	9898	9980	9163	9163
query79	1106	932	604	604
query80	670	568	506	506
query81	493	266	232	232
query82	1340	158	120	120
query83	378	266	250	250
query84	253	117	95	95
query85	829	495	437	437
query86	362	311	301	301
query87	3001	2851	2764	2764
query88	3556	2630	2617	2617
query89	395	351	326	326
query90	1884	179	164	164
query91	169	164	139	139
query92	78	75	71	71
query93	930	943	554	554
query94	454	324	315	315
query95	592	336	324	324
query96	648	510	232	232
query97	2399	2416	2346	2346
query98	226	211	201	201
query99	611	580	503	503
Total cold run time: 248787 ms
Total hot run time: 174953 ms

@doris-robot
Copy link

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

query1	0.06	0.05	0.05
query2	0.11	0.05	0.05
query3	0.27	0.09	0.09
query4	1.61	0.11	0.11
query5	0.28	0.26	0.25
query6	1.16	0.68	0.66
query7	0.04	0.03	0.02
query8	0.06	0.04	0.04
query9	0.57	0.52	0.50
query10	0.56	0.55	0.55
query11	0.14	0.10	0.10
query12	0.15	0.11	0.11
query13	0.59	0.58	0.58
query14	0.96	0.95	0.95
query15	0.79	0.78	0.79
query16	0.38	0.43	0.39
query17	1.04	1.06	1.06
query18	0.22	0.21	0.21
query19	1.89	1.82	1.76
query20	0.02	0.05	0.01
query21	15.45	0.29	0.15
query22	5.36	0.06	0.05
query23	15.90	0.28	0.10
query24	0.99	0.63	0.50
query25	0.07	0.07	0.07
query26	0.15	0.15	0.13
query27	0.08	0.05	0.06
query28	3.45	1.10	0.88
query29	12.53	3.96	3.13
query30	0.27	0.14	0.12
query31	2.82	0.64	0.40
query32	3.29	0.56	0.46
query33	2.96	3.06	3.12
query34	15.98	5.10	4.43
query35	4.45	4.44	4.42
query36	0.66	0.50	0.50
query37	0.11	0.07	0.06
query38	0.08	0.04	0.04
query39	0.05	0.03	0.03
query40	0.18	0.14	0.14
query41	0.09	0.04	0.03
query42	0.05	0.03	0.03
query43	0.05	0.03	0.03
Total cold run time: 95.92 s
Total hot run time: 27.08 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 90.91% (20/22) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 90.91% (20/22) 🎉
Increment coverage report
Complete coverage report

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.

4 participants