Skip to content

Conversation

@cambyzju
Copy link
Contributor

Support CREATE OR REPLACE VIEW stmt.

Usage example:

mysql>  CREATE VIEW IF NOT EXISTS view_test_create_or_replace_view
    ->         AS SELECT * FROM test_create_or_replace_view_tbl1;
Query OK, 0 rows affected (0.02 sec)

mysql> select * from view_test_create_or_replace_view;
+------+------+------+
| k1   | k2   | v    |
+------+------+------+
|    1 |    1 |    1 |
+------+------+------+
1 row in set (0.03 sec)

mysql> 
mysql>  CREATE OR REPLACE VIEW view_test_create_or_replace_view
    ->         AS SELECT * FROM test_create_or_replace_view_tbl2;
Query OK, 0 rows affected (0.01 sec)

mysql> select * from view_test_create_or_replace_view;
+------+------+------+
| k1   | k2   | v    |
+------+------+------+
|    2 |    2 |    2 |
+------+------+------+
1 row in set (0.03 sec)

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

@cambyzju
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	18348	4325	4296	4296
q2	2354	214	200	200
q3	11546	1381	1349	1349
q4	10362	973	982	973
q5	7765	3248	3229	3229
q6	233	143	142	142
q7	1056	669	647	647
q8	9459	1992	2036	1992
q9	6763	6292	6277	6277
q10	7031	2501	2518	2501
q11	435	254	253	253
q12	416	230	239	230
q13	17780	3043	3054	3043
q14	294	250	265	250
q15	536	473	494	473
q16	524	429	423	423
q17	1012	966	958	958
q18	7506	6664	6799	6664
q19	1378	1260	1234	1234
q20	604	334	345	334
q21	3931	3539	3533	3533
q22	1109	995	1010	995
Total cold run time: 110442 ms
Total hot run time: 39996 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4210	4181	4175	4175
q2	350	235	232	232
q3	2912	2905	2922	2905
q4	1978	1970	1989	1970
q5	5465	5452	5429	5429
q6	216	133	136	133
q7	2058	1689	1699	1689
q8	3263	3306	3266	3266
q9	8442	8471	8445	8445
q10	3376	3417	3426	3417
q11	569	479	484	479
q12	767	547	578	547
q13	5327	3115	3037	3037
q14	296	268	279	268
q15	530	481	493	481
q16	493	455	456	455
q17	1760	1707	1732	1707
q18	7935	7746	7507	7507
q19	1710	1716	1689	1689
q20	2059	1804	1801	1801
q21	5674	5375	5324	5324
q22	1077	987	1019	987
Total cold run time: 60467 ms
Total hot run time: 55943 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 195307 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 9b48a2eb8dccbbeeea1684d96107503f63807b0e, data reload: false

query1	920	387	379	379
query2	6495	1716	1695	1695
query3	6671	223	220	220
query4	27693	24262	24083	24083
query5	5274	564	540	540
query6	270	183	183	183
query7	4609	310	312	310
query8	296	231	226	226
query9	8518	2465	2439	2439
query10	482	296	290	290
query11	16348	15661	15699	15661
query12	160	104	103	103
query13	1668	402	383	383
query14	11640	7253	6911	6911
query15	223	175	181	175
query16	7633	492	457	457
query17	1528	601	585	585
query18	1984	303	308	303
query19	208	158	158	158
query20	125	115	117	115
query21	214	111	109	109
query22	4501	4251	4185	4185
query23	34612	33559	33812	33559
query24	9573	3192	3154	3154
query25	683	421	432	421
query26	1158	162	163	162
query27	2325	286	296	286
query28	6437	2058	2015	2015
query29	962	444	450	444
query30	308	164	160	160
query31	1012	806	794	794
query32	111	61	62	61
query33	738	318	321	318
query34	954	496	488	488
query35	893	744	768	744
query36	1073	920	880	880
query37	172	87	87	87
query38	4003	4034	3895	3895
query39	1488	1426	1415	1415
query40	214	123	124	123
query41	51	50	48	48
query42	127	102	101	101
query43	474	457	463	457
query44	1261	794	763	763
query45	202	179	176	176
query46	1136	841	813	813
query47	1865	1767	1786	1767
query48	371	297	292	292
query49	1110	485	470	470
query50	976	456	487	456
query51	7149	7101	6890	6890
query52	104	95	93	93
query53	267	197	193	193
query54	769	483	489	483
query55	86	80	80	80
query56	304	287	309	287
query57	1241	1084	1060	1060
query58	275	254	359	254
query59	2715	2504	2428	2428
query60	356	275	288	275
query61	108	99	100	99
query62	933	658	701	658
query63	232	203	200	200
query64	5341	675	688	675
query65	3466	3245	3209	3209
query66	1412	343	340	340
query67	16075	15842	15421	15421
query68	3445	873	848	848
query69	457	335	340	335
query70	1163	1135	1168	1135
query71	387	349	342	342
query72	6152	3458	3399	3399
query73	587	586	591	586
query74	9217	8983	8975	8975
query75	3178	3024	3005	3005
query76	2573	851	868	851
query77	482	425	419	419
query78	9673	9297	9313	9297
query79	959	938	865	865
query80	873	894	845	845
query81	449	268	265	265
query82	267	271	263	263
query83	199	201	203	201
query84	227	111	107	107
query85	687	406	397	397
query86	305	334	307	307
query87	4436	4397	4430	4397
query88	4112	4051	4032	4032
query89	377	369	369	369
query90	1272	327	323	323
query91	127	128	146	128
query92	84	82	80	80
query93	1056	1083	1059	1059
query94	618	447	388	388
query95	491	433	421	421
query96	472	468	467	467
query97	3105	3180	3137	3137
query98	233	234	226	226
query99	1538	1334	1335	1334
Total cold run time: 281783 ms
Total hot run time: 195307 ms

@doris-robot
Copy link

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

query1	0.05	0.05	0.04
query2	0.07	0.04	0.04
query3	0.23	0.05	0.05
query4	1.67	0.07	0.06
query5	0.50	0.50	0.52
query6	1.13	0.74	0.72
query7	0.02	0.01	0.01
query8	0.05	0.05	0.05
query9	0.57	0.55	0.53
query10	0.57	0.60	0.59
query11	0.16	0.13	0.12
query12	0.15	0.13	0.13
query13	0.63	0.61	0.61
query14	1.47	1.45	1.47
query15	0.92	0.88	0.88
query16	0.37	0.36	0.36
query17	1.04	1.01	1.03
query18	0.22	0.20	0.20
query19	1.95	1.82	1.80
query20	0.01	0.00	0.01
query21	15.40	0.67	0.68
query22	3.94	7.55	1.95
query23	18.11	1.22	1.23
query24	2.24	0.23	0.21
query25	0.18	0.08	0.08
query26	0.29	0.19	0.18
query27	0.08	0.08	0.07
query28	13.18	1.01	0.99
query29	12.54	3.33	3.28
query30	0.26	0.06	0.06
query31	2.87	0.44	0.41
query32	3.24	0.50	0.50
query33	3.02	3.01	3.06
query34	15.47	4.30	4.30
query35	4.36	4.35	4.35
query36	0.69	0.50	0.48
query37	0.19	0.17	0.15
query38	0.16	0.15	0.15
query39	0.06	0.04	0.04
query40	0.17	0.14	0.14
query41	0.11	0.05	0.05
query42	0.07	0.05	0.05
query43	0.05	0.04	0.04
Total cold run time: 108.46 s
Total hot run time: 31.53 s

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@cambyzju
Copy link
Contributor Author

run feut

@cambyzju
Copy link
Contributor Author

run cloud_p0

@cambyzju
Copy link
Contributor Author

run feut

Copy link
Contributor

@nextdreamblue nextdreamblue 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 Sep 18, 2024
@github-actions
Copy link
Contributor

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

@lide-reed lide-reed merged commit a3295d7 into apache:master Sep 18, 2024
cambyzju added a commit to cambyzju/incubator-doris that referenced this pull request Sep 18, 2024
Support `CREATE OR REPLACE VIEW` stmt.

Usage example:
```
mysql>  CREATE VIEW IF NOT EXISTS view_test_create_or_replace_view
    ->         AS SELECT * FROM test_create_or_replace_view_tbl1;
Query OK, 0 rows affected (0.02 sec)

mysql> select * from view_test_create_or_replace_view;
+------+------+------+
| k1   | k2   | v    |
+------+------+------+
|    1 |    1 |    1 |
+------+------+------+
1 row in set (0.03 sec)

mysql>  CREATE OR REPLACE VIEW view_test_create_or_replace_view
    ->         AS SELECT * FROM test_create_or_replace_view_tbl2;
Query OK, 0 rows affected (0.01 sec)

mysql> select * from view_test_create_or_replace_view;
+------+------+------+
| k1   | k2   | v    |
+------+------+------+
|    2 |    2 |    2 |
+------+------+------+
1 row in set (0.03 sec)
```
yiguolei pushed a commit that referenced this pull request Sep 18, 2024
dataroaring pushed a commit that referenced this pull request Oct 9, 2024
Support `CREATE OR REPLACE VIEW` stmt.

Usage example:
```
mysql>  CREATE VIEW IF NOT EXISTS view_test_create_or_replace_view
    ->         AS SELECT * FROM test_create_or_replace_view_tbl1;
Query OK, 0 rows affected (0.02 sec)

mysql> select * from view_test_create_or_replace_view;
+------+------+------+
| k1   | k2   | v    |
+------+------+------+
|    1 |    1 |    1 |
+------+------+------+
1 row in set (0.03 sec)

mysql>  CREATE OR REPLACE VIEW view_test_create_or_replace_view
    ->         AS SELECT * FROM test_create_or_replace_view_tbl2;
Query OK, 0 rows affected (0.01 sec)

mysql> select * from view_test_create_or_replace_view;
+------+------+------+
| k1   | k2   | v    |
+------+------+------+
|    2 |    2 |    2 |
+------+------+------+
1 row in set (0.03 sec)
```
morrySnow added a commit to morrySnow/incubator-doris that referenced this pull request May 20, 2025
this problem intro by apache#40715, when do replace view, full schema do not
be set correctly. So view's schema will lost after replace.
morrySnow added a commit that referenced this pull request May 20, 2025
### What problem does this PR solve?

Related PR: #40715

Problem Summary:

this problem intro by #40715, when do replace view, full schema do not
be set correctly. So view's schema will lost after replace.
github-actions bot pushed a commit that referenced this pull request May 20, 2025
### What problem does this PR solve?

Related PR: #40715

Problem Summary:

this problem intro by #40715, when do replace view, full schema do not
be set correctly. So view's schema will lost after replace.
koarz pushed a commit to koarz/doris that referenced this pull request Jun 4, 2025
### What problem does this PR solve?

Related PR: apache#40715

Problem Summary:

this problem intro by apache#40715, when do replace view, full schema do not
be set correctly. So view's schema will lost after replace.
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.7-merged dev/3.0.3-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants