Skip to content

branch-3.0: [Bug](mtmv) update mapping relation when mtmv occur alter #46983#47062

Merged
dataroaring merged 1 commit intobranch-3.0from
auto-pick-46983-branch-3.0
Feb 22, 2025
Merged

branch-3.0: [Bug](mtmv) update mapping relation when mtmv occur alter #46983#47062
dataroaring merged 1 commit intobranch-3.0from
auto-pick-46983-branch-3.0

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Cherry-picked from #46983

### What problem does this PR solve?

CREATE MATERIALIZED VIEW mv_a
REFRESH COMPLETE ON commit
DISTRIBUTED BY HASH(`sid`) BUCKETS 1 
PROPERTIES (
"replication_allocation" = "tag.location.default: 1"
)
AS  select * from stu limit 1;

CREATE MATERIALIZED VIEW mv_aa
REFRESH COMPLETE ON commit
DISTRIBUTED BY HASH(`sid`) BUCKETS 1 
PROPERTIES (
"replication_allocation" = "tag.location.default: 1"
)
AS  select * from mv_a limit 1;

alter MATERIALIZED VIEW mv_a RENAME mv_b

CREATE TABLE `mv_a` (
  `sid` int(32) NULL,
  `sname` varchar(32) NULL,
) ENGINE=OLAP
DUPLICATE KEY(`sid`)
DISTRIBUTED BY HASH(`sid`) BUCKETS 1
PROPERTIES (
"replication_allocation" = "tag.location.default: 1"
); 

CREATE MATERIALIZED VIEW mv_a
REFRESH COMPLETE ON commit
DISTRIBUTED BY HASH(`sid`) BUCKETS 1 
PROPERTIES (
"replication_allocation" = "tag.location.default: 1"
)
AS  select * from stu limit 1;

select * from stu limit 1;

java.lang.ClassCastException: class org.apache.doris.catalog.OlapTable cannot be cast to class org.apache.doris.catalog.MTMV (org.apache.doris.catalog.OlapTable and org.apache.doris.catalog.MTMV are in unnamed module of loader 'app')

---------

Co-authored-by: garenshi <garenshi@tencent.com>
@Thearas
Copy link
Copy Markdown
Contributor

Thearas commented Jan 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?

@dataroaring dataroaring reopened this Jan 16, 2025
@Thearas
Copy link
Copy Markdown
Contributor

Thearas commented Jan 16, 2025

run buildall

@doris-robot
Copy link
Copy Markdown

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

------ Round 1 ----------------------------------
q1	17595	7438	7343	7343
q2	2059	167	164	164
q3	10559	1140	1166	1140
q4	10384	800	750	750
q5	8123	2939	2870	2870
q6	242	151	149	149
q7	992	632	605	605
q8	9437	1977	2032	1977
q9	6841	6546	6519	6519
q10	7469	2310	2350	2310
q11	580	268	268	268
q12	417	223	226	223
q13	18254	3113	3113	3113
q14	262	222	215	215
q15	573	524	530	524
q16	685	626	621	621
q17	990	612	566	566
q18	7331	6774	6801	6774
q19	1398	1043	1023	1023
q20	466	201	197	197
q21	4063	3277	3289	3277
q22	1110	1018	1001	1001
Total cold run time: 109830 ms
Total hot run time: 41629 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7259	7217	7240	7217
q2	329	235	225	225
q3	3156	2968	2987	2968
q4	2086	1856	1784	1784
q5	5623	5715	5723	5715
q6	224	140	142	140
q7	2203	1796	1806	1796
q8	3329	3537	3483	3483
q9	8871	8861	8881	8861
q10	3593	3570	3562	3562
q11	609	504	518	504
q12	793	600	619	600
q13	6273	3151	3209	3151
q14	317	276	289	276
q15	599	537	532	532
q16	689	663	657	657
q17	1856	1605	1582	1582
q18	8299	7734	7515	7515
q19	1674	1590	1541	1541
q20	2049	1798	1817	1798
q21	5409	5180	5200	5180
q22	1113	1003	1005	1003
Total cold run time: 66353 ms
Total hot run time: 60090 ms

@doris-robot
Copy link
Copy Markdown

TPC-DS: Total hot run time: 192346 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 8d6349cec9f2df067427b4413c16f3dc3c148288, data reload: false

query1	967	371	374	371
query2	6510	2115	2065	2065
query3	6704	224	227	224
query4	34206	23580	23444	23444
query5	4295	468	445	445
query6	269	177	186	177
query7	4624	326	325	325
query8	291	218	214	214
query9	9522	2663	2669	2663
query10	477	284	268	268
query11	18277	15306	15386	15306
query12	152	102	103	102
query13	1623	440	431	431
query14	10503	7092	7223	7092
query15	264	171	178	171
query16	8131	484	469	469
query17	1645	603	581	581
query18	2141	313	318	313
query19	327	167	157	157
query20	118	108	108	108
query21	209	103	104	103
query22	4654	4332	4404	4332
query23	34928	33778	34048	33778
query24	11630	2886	2906	2886
query25	725	422	418	418
query26	1820	172	171	171
query27	2832	366	346	346
query28	7947	2452	2444	2444
query29	1052	464	474	464
query30	326	160	166	160
query31	1030	806	823	806
query32	91	60	56	56
query33	791	303	302	302
query34	940	512	552	512
query35	929	723	712	712
query36	1104	952	937	937
query37	165	75	75	75
query38	4017	3911	3907	3907
query39	1478	1413	1440	1413
query40	289	98	98	98
query41	48	50	50	50
query42	118	101	101	101
query43	521	483	482	482
query44	1271	798	803	798
query45	181	166	169	166
query46	1138	734	709	709
query47	1910	1815	1825	1815
query48	479	380	400	380
query49	1282	399	378	378
query50	822	424	422	422
query51	7209	7037	7051	7037
query52	100	88	91	88
query53	261	184	186	184
query54	1321	456	447	447
query55	80	75	77	75
query56	262	251	242	242
query57	1261	1097	1095	1095
query58	241	213	216	213
query59	3256	3040	2969	2969
query60	284	260	265	260
query61	113	111	116	111
query62	883	685	678	678
query63	233	202	193	193
query64	5243	685	658	658
query65	3306	3229	3183	3183
query66	1433	312	314	312
query67	16049	15627	15472	15472
query68	3584	608	605	605
query69	416	273	280	273
query70	1189	1155	1115	1115
query71	327	273	250	250
query72	6111	4146	4368	4146
query73	769	348	355	348
query74	10045	9091	9036	9036
query75	3428	2629	2716	2629
query76	2356	1058	1094	1058
query77	416	298	293	293
query78	10844	9708	9626	9626
query79	1100	598	608	598
query80	829	460	481	460
query81	524	245	244	244
query82	1232	117	132	117
query83	251	185	158	158
query84	237	82	79	79
query85	1120	312	317	312
query86	319	300	311	300
query87	4407	4379	4203	4203
query88	3544	2422	2394	2394
query89	413	300	302	300
query90	2181	189	187	187
query91	178	152	145	145
query92	67	47	53	47
query93	1071	551	558	551
query94	853	297	301	297
query95	362	261	261	261
query96	614	295	289	289
query97	3359	3168	3222	3168
query98	215	211	212	211
query99	1549	1297	1282	1282
Total cold run time: 301218 ms
Total hot run time: 192346 ms

@doris-robot
Copy link
Copy Markdown

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

query1	0.04	0.03	0.03
query2	0.07	0.03	0.04
query3	0.24	0.06	0.06
query4	1.62	0.11	0.10
query5	0.53	0.50	0.52
query6	1.13	0.72	0.72
query7	0.02	0.01	0.02
query8	0.06	0.03	0.03
query9	0.56	0.51	0.50
query10	0.55	0.54	0.55
query11	0.14	0.10	0.10
query12	0.14	0.11	0.11
query13	0.61	0.61	0.60
query14	3.01	2.97	3.01
query15	0.89	0.84	0.82
query16	0.40	0.38	0.41
query17	0.97	1.01	1.01
query18	0.24	0.22	0.22
query19	1.88	1.90	1.99
query20	0.01	0.01	0.01
query21	15.35	0.58	0.59
query22	2.69	2.33	1.64
query23	17.08	0.90	0.89
query24	3.34	1.53	1.58
query25	0.28	0.26	0.13
query26	0.57	0.13	0.13
query27	0.04	0.04	0.04
query28	9.52	1.12	1.08
query29	12.63	3.24	3.23
query30	0.25	0.06	0.05
query31	2.84	0.39	0.39
query32	3.24	0.46	0.46
query33	3.01	3.01	3.00
query34	16.87	4.52	4.52
query35	4.56	4.52	4.54
query36	0.67	0.50	0.50
query37	0.09	0.07	0.06
query38	0.05	0.04	0.03
query39	0.03	0.03	0.02
query40	0.16	0.12	0.13
query41	0.09	0.03	0.02
query42	0.03	0.02	0.02
query43	0.03	0.04	0.03
Total cold run time: 106.53 s
Total hot run time: 33.63 s

Copy link
Copy Markdown
Contributor

@dataroaring dataroaring left a comment

Choose a reason for hiding this comment

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

LGTM

@dataroaring dataroaring merged commit e4367e2 into branch-3.0 Feb 22, 2025
@github-actions github-actions Bot deleted the auto-pick-46983-branch-3.0 branch February 22, 2025 06:15
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