Skip to content

Conversation

@seawinde
Copy link
Contributor

What problem does this PR solve?

Fix exception when calc mtmv function dependency but the table in mtmv def sql is deleted
if mv2 use table1.
if table1 is deleted, selelct count(*) from mv2 should not throw exception.

Issue Number: close #xxx

Related PR: #48222

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 Apr 16, 2025

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

starocean999
starocean999 previously approved these changes Apr 16, 2025
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Apr 16, 2025
@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.

// select ${dbName2}.${mvName} should not throw exception
sql """
select count(*) from ${dbName2}.${mvName}
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

we should expect some result even if it's an expected error

@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Apr 16, 2025
@seawinde
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	25684	5098	5073	5073
q2	2072	299	190	190
q3	10356	1237	716	716
q4	10224	988	517	517
q5	7494	2343	2309	2309
q6	176	161	128	128
q7	901	721	607	607
q8	9308	1255	1046	1046
q9	6841	5106	5089	5089
q10	6852	2301	1854	1854
q11	482	287	272	272
q12	347	346	212	212
q13	17776	3683	3050	3050
q14	224	231	214	214
q15	534	480	505	480
q16	446	438	401	401
q17	608	859	359	359
q18	7474	7122	7195	7122
q19	1713	954	579	579
q20	333	327	227	227
q21	3988	3376	2433	2433
q22	1020	992	984	984
Total cold run time: 114853 ms
Total hot run time: 33862 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5208	5074	5143	5074
q2	244	331	227	227
q3	2151	2630	2257	2257
q4	1376	1784	1378	1378
q5	4435	4374	4373	4373
q6	208	172	124	124
q7	2030	1898	1743	1743
q8	2596	2535	2579	2535
q9	7272	7184	7014	7014
q10	2983	3167	2735	2735
q11	602	497	482	482
q12	702	762	636	636
q13	3490	3860	3298	3298
q14	301	315	276	276
q15	515	477	471	471
q16	453	500	461	461
q17	1148	1497	1424	1424
q18	7773	7485	7504	7485
q19	858	804	842	804
q20	1937	1958	1885	1885
q21	5285	4831	4806	4806
q22	1077	1044	1006	1006
Total cold run time: 52644 ms
Total hot run time: 50494 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 192240 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 4cb878ade627e38c0e15a5bc725ba43030ef5197, data reload: false

query1	1396	1061	1072	1061
query2	6077	1818	1808	1808
query3	11026	4595	4497	4497
query4	53502	25232	23127	23127
query5	5162	497	445	445
query6	314	212	188	188
query7	4889	489	274	274
query8	322	252	247	247
query9	5591	2564	2560	2560
query10	430	336	258	258
query11	15099	15456	14959	14959
query12	161	108	107	107
query13	1064	530	407	407
query14	10068	6290	6312	6290
query15	206	189	189	189
query16	7006	659	501	501
query17	1090	721	566	566
query18	1550	396	307	307
query19	189	195	164	164
query20	127	129	120	120
query21	206	127	107	107
query22	4414	4357	4283	4283
query23	34098	33537	33390	33390
query24	6648	2398	2435	2398
query25	454	477	390	390
query26	667	276	150	150
query27	2167	508	331	331
query28	3066	2145	2153	2145
query29	605	556	433	433
query30	282	229	198	198
query31	861	901	788	788
query32	72	68	66	66
query33	470	388	318	318
query34	778	880	512	512
query35	811	819	780	780
query36	973	1014	908	908
query37	113	107	77	77
query38	4169	4237	4257	4237
query39	1460	1444	1475	1444
query40	212	122	106	106
query41	54	55	50	50
query42	122	108	107	107
query43	520	523	481	481
query44	1298	803	808	803
query45	180	174	170	170
query46	848	1072	650	650
query47	1847	1857	1730	1730
query48	380	414	313	313
query49	669	531	426	426
query50	701	695	405	405
query51	4186	4284	4187	4187
query52	108	114	104	104
query53	235	267	187	187
query54	595	573	521	521
query55	83	85	82	82
query56	314	296	296	296
query57	1148	1163	1106	1106
query58	305	269	254	254
query59	2705	2804	2649	2649
query60	330	322	310	310
query61	129	123	142	123
query62	717	724	676	676
query63	226	187	182	182
query64	1433	1022	710	710
query65	4335	4245	4214	4214
query66	736	430	312	312
query67	15656	15348	15335	15335
query68	4311	913	527	527
query69	515	311	274	274
query70	1187	1138	1103	1103
query71	460	379	290	290
query72	5774	4953	4820	4820
query73	718	629	342	342
query74	9141	9358	8860	8860
query75	3501	3179	2706	2706
query76	3380	1178	748	748
query77	555	387	371	371
query78	9896	10141	9205	9205
query79	2256	819	563	563
query80	838	505	452	452
query81	490	253	220	220
query82	388	129	99	99
query83	259	247	233	233
query84	292	103	82	82
query85	741	400	334	334
query86	400	319	272	272
query87	4416	4467	4366	4366
query88	3016	2178	2135	2135
query89	382	316	287	287
query90	1869	217	206	206
query91	132	142	112	112
query92	71	61	60	60
query93	2695	963	582	582
query94	684	402	308	308
query95	370	290	310	290
query96	484	564	268	268
query97	3130	3237	3106	3106
query98	238	209	198	198
query99	1305	1419	1302	1302
Total cold run time: 291549 ms
Total hot run time: 192240 ms

@seawinde
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

query1	0.04	0.03	0.04
query2	0.12	0.10	0.11
query3	0.25	0.20	0.19
query4	1.59	0.19	0.20
query5	0.59	0.61	0.60
query6	1.19	0.70	0.72
query7	0.03	0.02	0.02
query8	0.04	0.03	0.03
query9	0.57	0.53	0.51
query10	0.58	0.57	0.56
query11	0.15	0.11	0.11
query12	0.15	0.11	0.12
query13	0.61	0.60	0.60
query14	1.16	1.18	1.20
query15	0.88	0.85	0.85
query16	0.39	0.40	0.39
query17	1.03	1.04	1.03
query18	0.21	0.19	0.19
query19	1.87	1.82	1.82
query20	0.02	0.01	0.01
query21	15.40	0.90	0.56
query22	0.77	1.17	0.80
query23	14.82	1.41	0.64
query24	6.87	1.47	0.62
query25	0.50	0.16	0.06
query26	0.68	0.16	0.13
query27	0.05	0.05	0.05
query28	8.82	0.88	0.44
query29	12.53	4.01	3.34
query30	0.25	0.08	0.07
query31	2.83	0.61	0.38
query32	3.22	0.55	0.48
query33	3.03	3.02	3.03
query34	15.76	5.11	4.43
query35	4.50	4.54	4.53
query36	0.67	0.50	0.48
query37	0.09	0.07	0.06
query38	0.05	0.04	0.03
query39	0.04	0.02	0.02
query40	0.18	0.14	0.13
query41	0.09	0.03	0.02
query42	0.03	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 102.69 s
Total hot run time: 29.56 s

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	26087	5035	5048	5035
q2	2053	271	185	185
q3	10482	1257	708	708
q4	10261	1003	535	535
q5	8051	2379	2339	2339
q6	185	160	129	129
q7	908	753	601	601
q8	9306	1289	1089	1089
q9	7338	5151	5217	5151
q10	6811	2313	1872	1872
q11	498	288	281	281
q12	345	348	219	219
q13	17778	3663	3117	3117
q14	228	230	214	214
q15	538	500	485	485
q16	450	442	390	390
q17	595	854	378	378
q18	7693	7224	7168	7168
q19	1212	933	542	542
q20	332	341	225	225
q21	4162	3409	2404	2404
q22	1041	1022	937	937
Total cold run time: 116354 ms
Total hot run time: 34004 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5133	5060	5205	5060
q2	239	330	232	232
q3	2168	2678	2294	2294
q4	1421	1808	1400	1400
q5	4213	4107	4101	4101
q6	211	164	126	126
q7	1872	1832	1647	1647
q8	2490	2528	2441	2441
q9	6769	6812	6723	6723
q10	2912	3050	2617	2617
q11	567	496	484	484
q12	649	712	588	588
q13	3297	3731	3102	3102
q14	267	274	257	257
q15	514	463	468	463
q16	462	487	441	441
q17	1111	1506	1353	1353
q18	7215	7059	7106	7059
q19	788	869	931	869
q20	1942	1952	1837	1837
q21	5117	4653	4676	4653
q22	1001	1025	983	983
Total cold run time: 50358 ms
Total hot run time: 48730 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 184472 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 0024b431ee92a6f4d6d298097ee3061f6c38b78d, data reload: false

query1	1020	480	505	480
query2	6555	1832	1826	1826
query3	6761	219	218	218
query4	26335	23950	22979	22979
query5	5845	652	461	461
query6	311	213	194	194
query7	4645	489	278	278
query8	297	263	236	236
query9	8624	2543	2583	2543
query10	549	320	273	273
query11	16075	15001	14765	14765
query12	173	111	111	111
query13	1668	519	396	396
query14	10957	6136	6133	6133
query15	219	198	166	166
query16	7687	636	456	456
query17	1565	765	589	589
query18	2033	409	303	303
query19	277	197	169	169
query20	122	123	112	112
query21	208	132	105	105
query22	4088	4090	4011	4011
query23	33879	32945	32787	32787
query24	8131	2355	2372	2355
query25	517	454	384	384
query26	1215	275	147	147
query27	2702	503	331	331
query28	4393	2102	2096	2096
query29	736	546	415	415
query30	283	222	184	184
query31	913	884	755	755
query32	79	65	65	65
query33	545	358	301	301
query34	773	854	497	497
query35	785	804	730	730
query36	949	971	880	880
query37	118	97	79	79
query38	4200	4105	4015	4015
query39	1464	1387	1370	1370
query40	207	114	105	105
query41	56	55	51	51
query42	120	102	109	102
query43	476	498	492	492
query44	1301	793	776	776
query45	172	169	169	169
query46	836	1039	608	608
query47	1739	1796	1674	1674
query48	367	398	302	302
query49	780	482	426	426
query50	634	674	391	391
query51	4155	4133	4109	4109
query52	116	112	100	100
query53	234	264	188	188
query54	574	593	503	503
query55	82	77	84	77
query56	306	299	293	293
query57	1140	1128	1078	1078
query58	258	254	258	254
query59	2623	2670	2530	2530
query60	324	310	299	299
query61	130	126	122	122
query62	788	710	669	669
query63	220	184	185	184
query64	4292	1000	689	689
query65	4321	4148	4215	4148
query66	1001	409	304	304
query67	15665	15332	15314	15314
query68	7906	877	511	511
query69	487	296	264	264
query70	1209	1063	1080	1063
query71	488	320	307	307
query72	5715	4727	4902	4727
query73	709	623	339	339
query74	9064	9085	8741	8741
query75	3794	3171	2711	2711
query76	3582	1192	744	744
query77	757	379	290	290
query78	9924	10147	9233	9233
query79	3307	804	555	555
query80	616	489	419	419
query81	476	251	217	217
query82	447	125	97	97
query83	284	246	247	246
query84	301	106	79	79
query85	755	352	309	309
query86	329	274	291	274
query87	4431	4524	4366	4366
query88	3319	2174	2198	2174
query89	429	321	274	274
query90	1940	211	206	206
query91	136	144	110	110
query92	78	58	55	55
query93	2381	923	578	578
query94	666	405	293	293
query95	364	294	281	281
query96	488	559	271	271
query97	3109	3209	3100	3100
query98	230	212	192	192
query99	1410	1419	1294	1294
Total cold run time: 279744 ms
Total hot run time: 184472 ms

@doris-robot
Copy link

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

query1	0.03	0.04	0.03
query2	0.12	0.11	0.11
query3	0.25	0.20	0.20
query4	1.60	0.20	0.19
query5	0.58	0.58	0.58
query6	1.19	0.72	0.72
query7	0.02	0.02	0.02
query8	0.04	0.03	0.03
query9	0.57	0.52	0.51
query10	0.56	0.57	0.56
query11	0.17	0.11	0.11
query12	0.15	0.11	0.12
query13	0.61	0.60	0.59
query14	1.18	1.17	1.17
query15	0.89	0.85	0.86
query16	0.39	0.39	0.38
query17	1.00	1.03	1.02
query18	0.21	0.20	0.20
query19	1.91	1.79	1.76
query20	0.01	0.02	0.01
query21	15.39	0.92	0.55
query22	0.75	1.24	0.94
query23	14.69	1.39	0.62
query24	6.88	1.17	1.27
query25	0.51	0.26	0.08
query26	0.65	0.16	0.14
query27	0.04	0.05	0.05
query28	9.48	0.89	0.44
query29	12.56	3.99	3.35
query30	0.27	0.11	0.06
query31	2.82	0.60	0.39
query32	3.22	0.54	0.47
query33	3.03	3.07	3.17
query34	15.81	5.10	4.48
query35	4.52	4.52	4.49
query36	0.68	0.49	0.47
query37	0.08	0.06	0.06
query38	0.05	0.04	0.03
query39	0.03	0.02	0.02
query40	0.17	0.14	0.14
query41	0.08	0.02	0.02
query42	0.03	0.02	0.02
query43	0.04	0.03	0.02
Total cold run time: 103.26 s
Total hot run time: 30.23 s

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Apr 16, 2025
@github-actions
Copy link
Contributor

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

@gavinchou gavinchou merged commit b957896 into apache:master Apr 17, 2025
27 checks passed
github-actions bot pushed a commit that referenced this pull request Apr 17, 2025
…table in mtmv def sql is deleted (#50096)

Fix exception when calc mtmv function dependency but the table in mtmv
def sql is deleted
if mv2 use table1.
if table1 is deleted, selelct count(*) from mv2 should not throw
exception.
dataroaring pushed a commit that referenced this pull request Apr 18, 2025
…ncy but the table in mtmv def sql is deleted #50096 (#50122)

Cherry-picked from #50096

Co-authored-by: seawinde <wusi@selectdb.com>
koarz pushed a commit to koarz/doris that referenced this pull request Jun 4, 2025
…table in mtmv def sql is deleted (apache#50096)

Fix exception when calc mtmv function dependency but the table in mtmv
def sql is deleted
if mv2 use table1.
if table1 is deleted, selelct count(*) from mv2 should not throw
exception.
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/3.0.5-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants