You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "Dragonliu2018 (via GitHub)" <gi...@apache.org> on 2024/03/06 17:11:30 UTC

[PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Dragonliu2018 opened a new pull request, #31893:
URL: https://github.com/apache/doris/pull/31893

   ## Proposed changes
   
   Issue Number: close #31348 
   
   Add a new command or key REMOVE to support delete catalog recycle bin.
   REMOVE is used similarly to RECOVER, refer to [RECOVER](https://doris.apache.org/zh-CN/docs/sql-manual/sql-reference/Database-Administration-Statements/RECOVER?_highlight=recover).
   If dbId/tableId/partitionId is not specified, the last dropped db/table/partition with the same name is removed by default.
   For example:
   1. Remove the database by name:
       ```sql
       REMOVE DATABASE db_name;
       ```
   2. Remove the table by name:
       ```sql
       REMOVE TABLE [db_name.]table_name;
       ```
   3. Remove the partition by name:
       ```sql
       REMOVE PARTITION partition_name FROM [db_name.]table_name;
       ```
   4. Remove the database by name and id:
       ```sql
       REMOVE DATABASE db_name db_id;
       ```
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "mymeiyi (via GitHub)" <gi...@apache.org>.
mymeiyi commented on code in PR #31893:
URL: https://github.com/apache/doris/pull/31893#discussion_r1582011534


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/DropCatalogRecycleBinStmt.java:
##########
@@ -0,0 +1,83 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.analysis;
+
+import org.apache.doris.common.AnalysisException;
+import org.apache.doris.common.UserException;
+
+/**
+ * Statement for drop a db/table/partition in catalog recycle bin.
+ */
+public class DropCatalogRecycleBinStmt extends DdlStmt {
+    private String idType;
+    private long dbId = -1;
+    private long tableId = -1;
+    private long partitionId = -1;
+
+    public DropCatalogRecycleBinStmt(String idType, long id) {
+        this.idType = idType;
+        if (idType.equals("'DbId'")) {

Review Comment:
   If user use `where "dbId" = ` command, what is the `idType`? should we consider `'` / `"` and case sensitivity?



##########
fe/fe-core/src/main/java/org/apache/doris/analysis/DropCatalogRecycleBinStmt.java:
##########
@@ -0,0 +1,83 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.analysis;
+
+import org.apache.doris.common.AnalysisException;
+import org.apache.doris.common.UserException;
+
+/**
+ * Statement for drop a db/table/partition in catalog recycle bin.
+ */
+public class DropCatalogRecycleBinStmt extends DdlStmt {
+    private String idType;
+    private long dbId = -1;
+    private long tableId = -1;
+    private long partitionId = -1;
+
+    public DropCatalogRecycleBinStmt(String idType, long id) {
+        this.idType = idType;
+        if (idType.equals("'DbId'")) {

Review Comment:
   If user use `where "dbid" = ` command, what is the `idType`? should we consider `'` / `"` and case sensitivity?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "Dragonliu2018 (via GitHub)" <gi...@apache.org>.
Dragonliu2018 commented on PR #31893:
URL: https://github.com/apache/doris/pull/31893#issuecomment-2136379218

   run buildall


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "mymeiyi (via GitHub)" <gi...@apache.org>.
mymeiyi commented on code in PR #31893:
URL: https://github.com/apache/doris/pull/31893#discussion_r1582033273


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/DropCatalogRecycleBinInfo.java:
##########
@@ -0,0 +1,102 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.trees.plans.commands.info;
+
+import org.apache.doris.analysis.DropCatalogRecycleBinStmt;
+import org.apache.doris.nereids.exceptions.AnalysisException;
+import org.apache.doris.qe.ConnectContext;
+
+/**
+ * drop catalog recycle db/table/partition info
+ */
+public class DropCatalogRecycleBinInfo {
+
+    private String idType;
+    private long dbId = -1;
+    private long tableId = -1;
+    private long partitionId = -1;
+
+    /**
+     *  constructor for DropCatalogRecycleBinInfo
+     */
+    public DropCatalogRecycleBinInfo(String idType, long id) {
+        this.idType = idType;
+        if (idType.equals("'DbId'")) {
+            this.dbId = id;
+        } else if (idType.equals("'TableId'")) {
+            this.tableId = id;
+        } else if (idType.equals("'PartitionId'")) {
+            this.partitionId = id;
+        }
+    }
+
+    /**
+     * analyze drop catalog recycle bin info
+     *
+     * @param ctx ConnectContext
+     */
+    public void analyze(ConnectContext ctx) {
+        if (!idType.equals("'DbId'") && !idType.equals("'TableId'") && !idType.equals("'PartitionId'")) {
+            String message = "DROP CATALOG RECYCLE BIN: " + idType + " should be 'DbId', 'TableId' or 'PartitionId'.";
+            throw new AnalysisException(message);
+        }
+    }
+
+    /**
+     * getIdType
+     */
+    public String getIdType() {
+        return idType;
+    }
+
+    /**
+     * getDbId
+     */
+    public long getDbId() {
+        return dbId;
+    }
+
+    /**
+     * getTableId
+     */
+    public long getTableId() {
+        return tableId;
+    }
+
+    /**
+     * getPartitionId
+     */
+    public long getPartitionId() {

Review Comment:
   Is the `getDbId`, `getTableId`, `getPartitionId` unuseful? 
   Maybe we can remove this class to simplify code?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #31893:
URL: https://github.com/apache/doris/pull/31893#issuecomment-2136467701

   
   <details>
   <summary>TPC-DS: <b>Total hot run time: 168835 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
   TPC-DS sf100 test result on commit 5ee18b76cc0466697d92471ff36c68015b5127af, data reload: false
   
   query1	946	385	376	376
   query2	6471	2438	2448	2438
   query3	6654	204	210	204
   query4	19886	17203	17556	17203
   query5	4123	418	424	418
   query6	246	157	164	157
   query7	4580	297	291	291
   query8	242	178	179	178
   query9	8670	2372	2367	2367
   query10	458	284	281	281
   query11	10407	10213	10070	10070
   query12	136	92	88	88
   query13	1644	364	378	364
   query14	9985	7630	6914	6914
   query15	205	166	159	159
   query16	7284	259	259	259
   query17	1314	539	538	538
   query18	1920	283	264	264
   query19	197	154	148	148
   query20	86	92	89	89
   query21	198	135	127	127
   query22	4285	3851	3799	3799
   query23	33503	32692	33104	32692
   query24	11862	2860	2899	2860
   query25	625	355	353	353
   query26	1713	156	158	156
   query27	2963	321	329	321
   query28	7416	2046	2042	2042
   query29	1151	625	601	601
   query30	223	157	150	150
   query31	960	735	776	735
   query32	85	53	53	53
   query33	754	270	267	267
   query34	999	466	483	466
   query35	713	638	593	593
   query36	1097	916	889	889
   query37	168	66	66	66
   query38	2880	2763	2751	2751
   query39	832	791	799	791
   query40	247	128	124	124
   query41	48	47	44	44
   query42	101	96	95	95
   query43	567	553	531	531
   query44	1176	735	766	735
   query45	181	193	166	166
   query46	1068	714	711	711
   query47	1822	1736	1782	1736
   query48	390	296	295	295
   query49	961	381	379	379
   query50	774	374	384	374
   query51	7006	6804	6718	6718
   query52	102	90	92	90
   query53	357	280	284	280
   query54	965	436	424	424
   query55	73	74	71	71
   query56	256	234	248	234
   query57	1109	1041	1038	1038
   query58	228	212	213	212
   query59	3398	3281	3193	3193
   query60	270	260	268	260
   query61	88	93	86	86
   query62	618	466	463	463
   query63	316	280	287	280
   query64	9668	2229	1761	1761
   query65	3204	3134	3105	3105
   query66	1406	329	324	324
   query67	15219	15082	15020	15020
   query68	4522	529	529	529
   query69	441	264	275	264
   query70	1121	1048	1096	1048
   query71	394	270	264	264
   query72	7334	2706	2561	2561
   query73	710	322	317	317
   query74	5997	5644	5511	5511
   query75	3252	2626	2634	2626
   query76	2224	944	979	944
   query77	405	267	268	267
   query78	10199	9773	9700	9700
   query79	1678	520	513	513
   query80	1120	440	432	432
   query81	532	225	221	221
   query82	953	93	96	93
   query83	246	170	170	170
   query84	248	84	84	84
   query85	1356	288	266	266
   query86	464	296	292	292
   query87	3330	3157	3110	3110
   query88	3497	2355	2352	2352
   query89	459	384	378	378
   query90	1947	189	189	189
   query91	128	103	97	97
   query92	58	50	49	49
   query93	1922	498	500	498
   query94	1297	235	185	185
   query95	396	311	313	311
   query96	584	267	272	267
   query97	3168	2989	2973	2973
   query98	258	224	209	209
   query99	1130	848	862	848
   Total cold run time: 270869 ms
   Total hot run time: 168835 ms
   ```
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #31893:
URL: https://github.com/apache/doris/pull/31893#issuecomment-2137956262

   
   <details>
   <summary>ClickBench: <b>Total hot run time: 30.58 s</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
   ClickBench test result on commit 51f208d6e4a2c6247f9d9de68fd4c8d49adcc2bc, data reload: false
   
   query1	0.04	0.04	0.04
   query2	0.09	0.04	0.04
   query3	0.24	0.05	0.05
   query4	1.67	0.09	0.10
   query5	0.50	0.48	0.49
   query6	1.14	0.72	0.72
   query7	0.02	0.02	0.01
   query8	0.06	0.04	0.04
   query9	0.53	0.49	0.49
   query10	0.54	0.55	0.55
   query11	0.15	0.11	0.12
   query12	0.15	0.13	0.12
   query13	0.61	0.59	0.60
   query14	0.78	0.77	0.80
   query15	0.82	0.82	0.81
   query16	0.37	0.37	0.37
   query17	1.00	0.99	0.96
   query18	0.21	0.24	0.25
   query19	1.89	1.74	1.69
   query20	0.02	0.01	0.02
   query21	15.45	0.74	0.70
   query22	4.34	7.89	1.63
   query23	18.32	1.39	1.43
   query24	1.34	0.37	0.26
   query25	0.14	0.08	0.08
   query26	0.26	0.17	0.17
   query27	0.08	0.08	0.08
   query28	13.37	1.02	0.99
   query29	12.73	3.35	3.30
   query30	0.24	0.05	0.06
   query31	2.87	0.40	0.39
   query32	3.26	0.47	0.48
   query33	2.91	2.90	2.97
   query34	17.05	4.45	4.46
   query35	4.59	4.49	4.58
   query36	0.69	0.47	0.46
   query37	0.17	0.15	0.15
   query38	0.15	0.14	0.15
   query39	0.04	0.04	0.04
   query40	0.17	0.15	0.14
   query41	0.08	0.04	0.05
   query42	0.06	0.04	0.05
   query43	0.04	0.04	0.04
   Total cold run time: 109.18 s
   Total hot run time: 30.58 s
   ```
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #31893:
URL: https://github.com/apache/doris/pull/31893#issuecomment-2136460631

   
   <details>
   <summary>TPC-H: <b>Total hot run time: 42052 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
   Tpch sf100 test result on commit 5ee18b76cc0466697d92471ff36c68015b5127af, data reload: false
   
   ------ Round 1 ----------------------------------
   q1	17613	4409	4275	4275
   q2	2026	201	197	197
   q3	10462	1252	1189	1189
   q4	10193	832	794	794
   q5	7543	2774	2701	2701
   q6	216	136	139	136
   q7	994	640	615	615
   q8	9238	2123	2137	2123
   q9	9125	6639	6709	6639
   q10	9095	3954	3882	3882
   q11	477	265	248	248
   q12	493	229	226	226
   q13	17224	3303	3304	3303
   q14	278	230	219	219
   q15	521	481	487	481
   q16	513	411	410	410
   q17	1000	677	728	677
   q18	8324	7927	7733	7733
   q19	6572	1557	1546	1546
   q20	639	326	340	326
   q21	5352	4059	4120	4059
   q22	359	278	273	273
   Total cold run time: 118257 ms
   Total hot run time: 42052 ms
   
   ----- Round 2, with runtime_filter_mode=off -----
   q1	4523	4399	4446	4399
   q2	393	277	283	277
   q3	3142	2915	2900	2900
   q4	2053	1696	1627	1627
   q5	5418	5526	5509	5509
   q6	221	126	126	126
   q7	2225	1837	1784	1784
   q8	3237	3466	3356	3356
   q9	8655	8724	8745	8724
   q10	4128	3782	3692	3692
   q11	595	488	502	488
   q12	786	625	613	613
   q13	16956	3136	3141	3136
   q14	292	259	267	259
   q15	523	493	474	474
   q16	478	447	442	442
   q17	1792	1565	1552	1552
   q18	7885	7634	7317	7317
   q19	1667	1547	1601	1547
   q20	1996	1758	1772	1758
   q21	13155	4785	4797	4785
   q22	538	491	489	489
   Total cold run time: 80658 ms
   Total hot run time: 55254 ms
   ```
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #31893:
URL: https://github.com/apache/doris/pull/31893#issuecomment-2081101191

   
   <details>
   <summary>TPC-DS: <b>Total hot run time: 187625 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
   TPC-DS sf100 test result on commit 95b6d377d576667c4023570de395cf8e57065e8e, data reload: false
   
   query1	909	367	354	354
   query2	6453	2339	2464	2339
   query3	6644	208	206	206
   query4	23095	21179	21367	21179
   query5	4142	420	426	420
   query6	271	180	213	180
   query7	4596	293	283	283
   query8	238	194	195	194
   query9	8534	2331	2318	2318
   query10	433	252	268	252
   query11	14852	14161	14352	14161
   query12	143	89	90	89
   query13	1631	392	388	388
   query14	10608	7646	7667	7646
   query15	225	187	181	181
   query16	7760	261	261	261
   query17	1708	599	572	572
   query18	1970	283	299	283
   query19	205	158	157	157
   query20	95	89	87	87
   query21	198	131	137	131
   query22	4985	4820	4819	4819
   query23	33747	33308	33342	33308
   query24	6956	2990	3030	2990
   query25	614	405	400	400
   query26	713	162	159	159
   query27	2121	324	331	324
   query28	4426	2038	2036	2036
   query29	874	646	630	630
   query30	241	156	158	156
   query31	983	756	749	749
   query32	91	54	60	54
   query33	488	267	270	267
   query34	864	489	496	489
   query35	793	688	721	688
   query36	1033	907	946	907
   query37	106	73	71	71
   query38	3202	3040	2996	2996
   query39	1570	1531	1549	1531
   query40	193	131	134	131
   query41	41	38	38	38
   query42	105	103	95	95
   query43	560	526	543	526
   query44	1095	733	742	733
   query45	278	263	242	242
   query46	1076	753	717	717
   query47	1918	1833	1848	1833
   query48	373	294	290	290
   query49	829	406	405	405
   query50	778	397	380	380
   query51	6918	6801	6783	6783
   query52	107	92	89	89
   query53	352	292	288	288
   query54	266	245	242	242
   query55	79	73	74	73
   query56	253	232	231	231
   query57	1229	1106	1126	1106
   query58	217	205	204	204
   query59	3622	3272	3069	3069
   query60	266	242	242	242
   query61	95	91	111	91
   query62	623	437	452	437
   query63	319	287	286	286
   query64	8192	7163	7150	7150
   query65	3145	3065	3055	3055
   query66	795	344	341	341
   query67	15835	14815	14924	14815
   query68	8878	538	586	538
   query69	544	310	311	310
   query70	1189	1146	1145	1145
   query71	465	277	276	276
   query72	8114	2643	2428	2428
   query73	745	328	324	324
   query74	6595	6110	6071	6071
   query75	4298	2678	2698	2678
   query76	4761	1030	1069	1030
   query77	689	270	270	270
   query78	11003	10321	10139	10139
   query79	11825	517	518	517
   query80	1430	442	441	441
   query81	499	225	221	221
   query82	240	93	94	93
   query83	199	172	167	167
   query84	266	83	83	83
   query85	884	316	266	266
   query86	348	316	308	308
   query87	3311	3130	3074	3074
   query88	5264	2334	2322	2322
   query89	520	385	387	385
   query90	2064	188	185	185
   query91	125	101	95	95
   query92	67	49	54	49
   query93	6324	510	498	498
   query94	1345	189	191	189
   query95	1096	1091	1091	1091
   query96	631	266	258	258
   query97	3148	2953	2968	2953
   query98	234	215	222	215
   query99	1110	859	884	859
   Total cold run time: 296287 ms
   Total hot run time: 187625 ms
   ```
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
morrySnow commented on code in PR #31893:
URL: https://github.com/apache/doris/pull/31893#discussion_r1582005049


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/DropCatalogRecycleBinCommand.java:
##########
@@ -0,0 +1,54 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.trees.plans.commands;
+
+import org.apache.doris.catalog.Env;
+import org.apache.doris.nereids.trees.plans.PlanType;
+import org.apache.doris.nereids.trees.plans.commands.info.DropCatalogRecycleBinInfo;
+import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
+import org.apache.doris.qe.ConnectContext;
+import org.apache.doris.qe.StmtExecutor;
+
+import java.util.Objects;
+
+/**
+ * drop catalog recycle bin command
+ */
+public class DropCatalogRecycleBinCommand extends Command implements NoForward {

Review Comment:
   forwardSync



##########
fe/fe-core/src/main/java/org/apache/doris/analysis/DropCatalogRecycleBinStmt.java:
##########
@@ -0,0 +1,83 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.analysis;
+
+import org.apache.doris.common.AnalysisException;
+import org.apache.doris.common.UserException;
+
+/**
+ * Statement for drop a db/table/partition in catalog recycle bin.
+ */
+public class DropCatalogRecycleBinStmt extends DdlStmt {

Review Comment:
   if u do not want impl this statement in Legacy planner. i think we could do all thing in `DropCatalogRecycleBinCommand#run` directly. it is not necessary to tran it into `DropCatalogRecycleBinStmt `.



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java:
##########
@@ -3496,8 +3499,17 @@ public LogicalPlan visitShowCreateProcedure(ShowCreateProcedureContext ctx) {
         return ParserUtils.withOrigin(ctx, () -> new ShowCreateProcedureCommand(procedureName));
     }
 
+    @Override
+    public LogicalPlan visitDropCatalogRecycleBin(DropCatalogRecycleBinContext ctx) {
+        String idType = String.valueOf(ctx.idType.getText());
+        long id = Long.valueOf(ctx.id.getText());

Review Comment:
   ```suggestion
           long id = Long.parseLong(ctx.id.getText());
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "mymeiyi (via GitHub)" <gi...@apache.org>.
mymeiyi commented on code in PR #31893:
URL: https://github.com/apache/doris/pull/31893#discussion_r1618082274


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/CatalogRecycleBin.java:
##########
@@ -907,6 +907,117 @@ public synchronized void replayRecoverPartition(OlapTable table, long partitionI
         }
     }
 
+    // erase database in catalog recycle bin instantly
+    public synchronized void eraseDatabaseInstantly(long dbId) throws DdlException {
+        // 1. find dbInfo to erase
+        RecycleDatabaseInfo dbInfo = idToDatabase.get(dbId);
+        if (dbInfo == null) {
+            throw new DdlException("Unknown database id '" + dbId + "'");
+        }
+
+        // 2. erase db
+        Env.getCurrentEnv().eraseDatabase(dbId, true);
+
+        // 3. erase db from idToDatabase and idToRecycleTime
+        idToDatabase.remove(dbId);
+        idToRecycleTime.remove(dbId);
+
+        // 4. log for erase db
+        String dbName = dbInfo.getDb().getName();
+        LOG.info("erase db[{}]: {}", dbId, dbName);
+
+        // 5. remove all tables with the same dbId
+        List<Long> tableIdToErase = Lists.newArrayList();
+        Iterator<Map.Entry<Long, RecycleTableInfo>> tableIterator = idToTable.entrySet().iterator();
+        while (tableIterator.hasNext()) {
+            Map.Entry<Long, RecycleTableInfo> entry = tableIterator.next();
+            RecycleTableInfo tableInfo = entry.getValue();
+            if (tableInfo.getDbId() == dbId) {
+                tableIdToErase.add(entry.getKey());
+            }
+        }
+        for (Long tableId : tableIdToErase) {
+            eraseTableInstantly(tableId);
+        }
+
+        // 6. remove all partitions with the same dbId
+        List<Long> partitionIdToErase = Lists.newArrayList();
+        Iterator<Map.Entry<Long, RecyclePartitionInfo>> partitionIterator = idToPartition.entrySet().iterator();
+        while (partitionIterator.hasNext()) {
+            Map.Entry<Long, RecyclePartitionInfo> entry = partitionIterator.next();
+            RecyclePartitionInfo partitionInfo = entry.getValue();
+            if (partitionInfo.getDbId() == dbId) {
+                partitionIdToErase.add(entry.getKey());
+            }
+        }
+        for (Long partitionId : partitionIdToErase) {
+            erasePartitionInstantly(partitionId);
+        }
+    }
+
+    // erase table in catalog recycle bin instantly
+    public synchronized void eraseTableInstantly(long tableId) throws DdlException {
+        // 1. find tableInfo to erase
+        RecycleTableInfo tableInfo = idToTable.get(tableId);
+        if (tableInfo == null) {
+            throw new DdlException("Unknown table id '" + tableId + "'");
+        }
+
+        // 2. erase table
+        long dbId = tableInfo.getDbId();
+        Table table = tableInfo.getTable();
+        if (table.getType() == TableType.OLAP || table.getType() == TableType.MATERIALIZED_VIEW) {

Review Comment:
   table.isManagedTable()



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #31893:
URL: https://github.com/apache/doris/pull/31893#issuecomment-2136397862

   PR approved by anyone and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #31893:
URL: https://github.com/apache/doris/pull/31893#issuecomment-2137930198

   
   <details>
   <summary>TPC-H: <b>Total hot run time: 42214 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
   Tpch sf100 test result on commit 51f208d6e4a2c6247f9d9de68fd4c8d49adcc2bc, data reload: false
   
   ------ Round 1 ----------------------------------
   q1	17615	4349	4244	4244
   q2	2033	198	204	198
   q3	10434	1184	1200	1184
   q4	10192	807	852	807
   q5	7494	2733	2757	2733
   q6	220	134	142	134
   q7	967	654	635	635
   q8	9242	2177	2117	2117
   q9	9226	6724	6742	6724
   q10	9675	3932	3867	3867
   q11	448	246	243	243
   q12	454	249	247	247
   q13	17222	3169	3289	3169
   q14	271	232	235	232
   q15	516	467	488	467
   q16	487	395	404	395
   q17	975	715	745	715
   q18	8389	7705	7828	7705
   q19	5554	1673	1656	1656
   q20	619	322	312	312
   q21	5166	4100	4090	4090
   q22	398	340	341	340
   Total cold run time: 117597 ms
   Total hot run time: 42214 ms
   
   ----- Round 2, with runtime_filter_mode=off -----
   q1	4640	4487	4468	4468
   q2	388	273	266	266
   q3	3145	2871	3024	2871
   q4	1920	1654	1572	1572
   q5	5484	5554	5521	5521
   q6	224	130	133	130
   q7	2214	1799	1896	1799
   q8	3303	3434	3437	3434
   q9	8674	8799	8786	8786
   q10	4114	3780	3890	3780
   q11	607	494	520	494
   q12	827	625	649	625
   q13	16069	3193	3221	3193
   q14	308	278	279	278
   q15	541	496	499	496
   q16	534	446	449	446
   q17	1835	1548	1528	1528
   q18	8004	7931	7698	7698
   q19	2904	1596	1641	1596
   q20	2118	1892	1907	1892
   q21	15307	5006	4959	4959
   q22	615	549	554	549
   Total cold run time: 83775 ms
   Total hot run time: 56381 ms
   ```
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #31893:
URL: https://github.com/apache/doris/pull/31893#issuecomment-2138896589

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "Dragonliu2018 (via GitHub)" <gi...@apache.org>.
Dragonliu2018 commented on PR #31893:
URL: https://github.com/apache/doris/pull/31893#issuecomment-2136440635

   run buildall


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "Dragonliu2018 (via GitHub)" <gi...@apache.org>.
Dragonliu2018 commented on PR #31893:
URL: https://github.com/apache/doris/pull/31893#issuecomment-2137870403

   run buildall


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #31893:
URL: https://github.com/apache/doris/pull/31893#issuecomment-1981379128

   Thank you for your contribution to Apache Doris.
   Don't know what should be done next? See [How to process your PR](https://cwiki.apache.org/confluence/display/DORIS/How+to+process+your+PR)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #31893:
URL: https://github.com/apache/doris/pull/31893#issuecomment-2081092018

   
   <details>
   <summary>TPC-H: <b>Total hot run time: 41492 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
   Tpch sf100 test result on commit 95b6d377d576667c4023570de395cf8e57065e8e, data reload: false
   
   ------ Round 1 ----------------------------------
   q1	17617	4286	4271	4271
   q2	2026	194	189	189
   q3	10462	1189	1239	1189
   q4	10190	881	814	814
   q5	7526	2772	2749	2749
   q6	219	133	136	133
   q7	1058	637	658	637
   q8	9239	2133	2117	2117
   q9	10611	6850	6810	6810
   q10	9443	3905	3967	3905
   q11	459	257	247	247
   q12	455	220	223	220
   q13	17216	3124	3180	3124
   q14	276	241	246	241
   q15	520	489	481	481
   q16	474	381	376	376
   q17	967	702	743	702
   q18	8362	7837	7715	7715
   q19	5765	1568	1533	1533
   q20	639	327	321	321
   q21	5243	3439	4193	3439
   q22	345	279	288	279
   Total cold run time: 119112 ms
   Total hot run time: 41492 ms
   
   ----- Round 2, with runtime_filter_mode=off -----
   q1	4593	4472	4422	4422
   q2	377	266	272	266
   q3	3203	2952	3017	2952
   q4	1941	1584	1571	1571
   q5	5496	5525	5523	5523
   q6	212	125	132	125
   q7	2329	2022	1982	1982
   q8	3280	3443	3389	3389
   q9	8902	8878	8942	8878
   q10	4049	3720	3887	3720
   q11	579	486	495	486
   q12	817	625	631	625
   q13	16634	3153	3209	3153
   q14	316	295	282	282
   q15	529	488	485	485
   q16	497	430	438	430
   q17	1784	1494	1485	1485
   q18	7670	7516	7482	7482
   q19	1649	1499	1564	1499
   q20	2010	1806	1778	1778
   q21	12626	4671	4835	4671
   q22	560	502	503	502
   Total cold run time: 80053 ms
   Total hot run time: 55706 ms
   ```
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "Dragonliu2018 (via GitHub)" <gi...@apache.org>.
Dragonliu2018 commented on PR #31893:
URL: https://github.com/apache/doris/pull/31893#issuecomment-2081005304

   run buildall


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "Dragonliu2018 (via GitHub)" <gi...@apache.org>.
Dragonliu2018 commented on PR #31893:
URL: https://github.com/apache/doris/pull/31893#issuecomment-2134249892

   run buildall


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #31893:
URL: https://github.com/apache/doris/pull/31893#issuecomment-2136471730

   
   <details>
   <summary>ClickBench: <b>Total hot run time: 30.76 s</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
   ClickBench test result on commit 5ee18b76cc0466697d92471ff36c68015b5127af, data reload: false
   
   query1	0.05	0.03	0.03
   query2	0.09	0.04	0.04
   query3	0.23	0.06	0.06
   query4	1.66	0.08	0.07
   query5	0.50	0.49	0.48
   query6	1.12	0.72	0.73
   query7	0.02	0.02	0.01
   query8	0.06	0.04	0.04
   query9	0.53	0.48	0.49
   query10	0.54	0.55	0.54
   query11	0.16	0.11	0.11
   query12	0.14	0.11	0.12
   query13	0.60	0.59	0.59
   query14	0.76	0.77	0.77
   query15	0.83	0.81	0.80
   query16	0.37	0.37	0.37
   query17	0.95	0.96	0.99
   query18	0.21	0.24	0.25
   query19	1.74	1.65	1.65
   query20	0.01	0.01	0.01
   query21	15.43	0.71	0.69
   query22	4.66	6.22	2.11
   query23	18.66	1.37	1.26
   query24	1.93	0.23	0.23
   query25	0.15	0.08	0.08
   query26	0.26	0.16	0.17
   query27	0.08	0.08	0.08
   query28	13.23	1.01	1.01
   query29	13.22	3.34	3.29
   query30	0.24	0.06	0.05
   query31	2.89	0.38	0.38
   query32	3.29	0.47	0.46
   query33	2.88	2.91	2.95
   query34	17.16	4.44	4.51
   query35	4.49	4.50	4.65
   query36	0.67	0.45	0.46
   query37	0.17	0.15	0.16
   query38	0.15	0.14	0.14
   query39	0.04	0.03	0.03
   query40	0.16	0.14	0.15
   query41	0.08	0.04	0.05
   query42	0.05	0.05	0.05
   query43	0.05	0.04	0.03
   Total cold run time: 110.51 s
   Total hot run time: 30.76 s
   ```
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "Dragonliu2018 (via GitHub)" <gi...@apache.org>.
Dragonliu2018 commented on PR #31893:
URL: https://github.com/apache/doris/pull/31893#issuecomment-1982277405

   run buildall


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #31893:
URL: https://github.com/apache/doris/pull/31893#issuecomment-2137947502

   
   <details>
   <summary>TPC-DS: <b>Total hot run time: 169582 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
   TPC-DS sf100 test result on commit 51f208d6e4a2c6247f9d9de68fd4c8d49adcc2bc, data reload: false
   
   query1	957	395	380	380
   query2	7671	2620	2493	2493
   query3	6648	217	214	214
   query4	19484	17175	17439	17175
   query5	4129	447	442	442
   query6	250	170	196	170
   query7	4784	309	304	304
   query8	330	303	299	299
   query9	8468	2364	2380	2364
   query10	458	287	269	269
   query11	10588	10067	10055	10055
   query12	143	94	89	89
   query13	1637	362	359	359
   query14	10288	7701	6292	6292
   query15	240	193	189	189
   query16	8079	264	262	262
   query17	1716	528	529	528
   query18	2069	270	273	270
   query19	209	162	156	156
   query20	98	88	86	86
   query21	199	134	129	129
   query22	4131	3923	3917	3917
   query23	33625	33228	33082	33082
   query24	9996	2875	2798	2798
   query25	566	375	389	375
   query26	703	165	167	165
   query27	2154	322	322	322
   query28	5544	2085	2055	2055
   query29	885	627	620	620
   query30	247	152	158	152
   query31	970	771	761	761
   query32	100	55	59	55
   query33	688	326	265	265
   query34	869	491	483	483
   query35	708	659	619	619
   query36	1128	947	914	914
   query37	108	68	69	68
   query38	2905	2762	2753	2753
   query39	836	793	806	793
   query40	202	128	129	128
   query41	54	51	56	51
   query42	103	98	101	98
   query43	601	539	550	539
   query44	1108	734	749	734
   query45	180	177	168	168
   query46	1073	743	729	729
   query47	1848	1787	1758	1758
   query48	375	296	288	288
   query49	850	379	394	379
   query50	782	411	406	406
   query51	6868	6743	6796	6743
   query52	106	94	94	94
   query53	355	294	301	294
   query54	842	436	430	430
   query55	78	75	73	73
   query56	264	250	268	250
   query57	1095	1042	1026	1026
   query58	234	214	219	214
   query59	3527	3258	3329	3258
   query60	284	289	269	269
   query61	94	90	90	90
   query62	615	447	453	447
   query63	315	293	302	293
   query64	8567	2260	1757	1757
   query65	3177	3103	3203	3103
   query66	764	332	316	316
   query67	15256	14726	14644	14644
   query68	4537	535	525	525
   query69	457	279	276	276
   query70	1166	1152	1147	1147
   query71	407	273	277	273
   query72	7523	5673	2731	2731
   query73	726	325	324	324
   query74	6007	5603	5691	5603
   query75	3386	2629	2637	2629
   query76	2857	971	975	971
   query77	559	277	274	274
   query78	10152	9846	9843	9843
   query79	2144	528	539	528
   query80	1213	455	443	443
   query81	538	226	217	217
   query82	661	98	94	94
   query83	245	175	200	175
   query84	249	84	91	84
   query85	1801	275	276	275
   query86	485	315	297	297
   query87	3290	3132	3124	3124
   query88	4305	2359	2338	2338
   query89	525	408	402	402
   query90	2061	198	191	191
   query91	125	103	98	98
   query92	60	51	53	51
   query93	2352	517	500	500
   query94	1320	192	188	188
   query95	408	315	317	315
   query96	624	264	268	264
   query97	3185	3035	3030	3030
   query98	250	217	223	217
   query99	1098	872	854	854
   Total cold run time: 268941 ms
   Total hot run time: 169582 ms
   ```
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
morrySnow merged PR #31893:
URL: https://github.com/apache/doris/pull/31893


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "mymeiyi (via GitHub)" <gi...@apache.org>.
mymeiyi commented on code in PR #31893:
URL: https://github.com/apache/doris/pull/31893#discussion_r1582037708


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/CatalogRecycleBin.java:
##########
@@ -894,6 +894,68 @@ public synchronized void replayRecoverPartition(OlapTable table, long partitionI
         }
     }
 
+    // erase database in catalog recycle bin instantly
+    public synchronized void eraseDatabaseInstantly(long dbId) throws DdlException {

Review Comment:
   We should also remove the partitions and tables with the same dbId, not only database



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "mymeiyi (via GitHub)" <gi...@apache.org>.
mymeiyi commented on code in PR #31893:
URL: https://github.com/apache/doris/pull/31893#discussion_r1582011534


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/DropCatalogRecycleBinStmt.java:
##########
@@ -0,0 +1,83 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.analysis;
+
+import org.apache.doris.common.AnalysisException;
+import org.apache.doris.common.UserException;
+
+/**
+ * Statement for drop a db/table/partition in catalog recycle bin.
+ */
+public class DropCatalogRecycleBinStmt extends DdlStmt {
+    private String idType;
+    private long dbId = -1;
+    private long tableId = -1;
+    private long partitionId = -1;
+
+    public DropCatalogRecycleBinStmt(String idType, long id) {
+        this.idType = idType;
+        if (idType.equals("'DbId'")) {

Review Comment:
   If user use `where "dbid" = ` command, what is the `idType`? should we consider `'`, `"` and case sensitivity?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
morrySnow commented on code in PR #31893:
URL: https://github.com/apache/doris/pull/31893#discussion_r1618161303


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java:
##########
@@ -3543,6 +3546,26 @@ public LogicalPlan visitShowCreateProcedure(ShowCreateProcedureContext ctx) {
         return ParserUtils.withOrigin(ctx, () -> new ShowCreateProcedureCommand(procedureName));
     }
 
+    @Override
+    public LogicalPlan visitDropCatalogRecycleBin(DropCatalogRecycleBinContext ctx) {
+        String idTypeStr = ctx.idType.getText().substring(1, ctx.idType.getText().length() - 1);
+        IdType idType;
+        if (idTypeStr.equalsIgnoreCase("DbId")) {

Review Comment:
   u should move this code block to enum type IdType. for example:
   ```
   public static IdType valueOf(String idType) {
     ...
   } 
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "Dragonliu2018 (via GitHub)" <gi...@apache.org>.
Dragonliu2018 commented on code in PR #31893:
URL: https://github.com/apache/doris/pull/31893#discussion_r1616222523


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/CatalogRecycleBin.java:
##########
@@ -894,6 +894,68 @@ public synchronized void replayRecoverPartition(OlapTable table, long partitionI
         }
     }
 
+    // erase database in catalog recycle bin instantly
+    public synchronized void eraseDatabaseInstantly(long dbId) throws DdlException {

Review Comment:
   when remove a table, we should also remove the partitions with the same tableId, not only table?
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
morrySnow commented on code in PR #31893:
URL: https://github.com/apache/doris/pull/31893#discussion_r1616512303


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/DropCatalogRecycleBinInfo.java:
##########
@@ -0,0 +1,91 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.trees.plans.commands.info;
+
+import org.apache.doris.nereids.exceptions.AnalysisException;
+import org.apache.doris.qe.ConnectContext;
+
+/**
+ * drop catalog recycle db/table/partition info
+ */
+public class DropCatalogRecycleBinInfo {
+
+    private String idType;

Review Comment:
   use enum to avoid write too many idType.equalsIgnoreCase. then u could only use one id attr to represent diff type id according to idType



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java:
##########
@@ -708,6 +709,22 @@ public void recoverPartition(RecoverPartitionStmt recoverStmt) throws DdlExcepti
         }
     }
 
+    public void dropCatalogRecycleBin(DropCatalogRecycleBinInfo dropInfo) throws DdlException {
+        if (dropInfo.getIdType().equalsIgnoreCase("'DbId'")
+                || dropInfo.getIdType().equalsIgnoreCase("\"DbId\"")) {
+            Env.getCurrentRecycleBin().eraseDatabaseInstantly(dropInfo.getDbId());
+            LOG.info("drop database[{}] in catalog recycle bin", dropInfo.getDbId());
+        } else if (dropInfo.getIdType().equalsIgnoreCase("'TableId'")
+                || dropInfo.getIdType().equalsIgnoreCase("\"TableId\"")) {
+            Env.getCurrentRecycleBin().eraseTableInstantly(dropInfo.getTableId());
+            LOG.info("drop table[{}] in catalog recycle bin", dropInfo.getTableId());
+        } else if (dropInfo.getIdType().equalsIgnoreCase("'PartitionId'")
+                || dropInfo.getIdType().equalsIgnoreCase("\"PartitionId\"")) {
+            Env.getCurrentRecycleBin().erasePartitionInstantly(dropInfo.getPartitionId());
+            LOG.info("drop partition[{}] in catalog recycle bin", dropInfo.getPartitionId());
+        }

Review Comment:
   when u use enum then u could write like:
   ```java
   switch (dropInfo.getIdType()) {
     case DATABASE_ID:
       Env.getCurrentRecycleBin().eraseDatabaseInstantly(dropInfo.getId());
       LOG.info("drop database[{}] in catalog recycle bin", dropInfo.getId());
       break;
     ...
   }
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java:
##########
@@ -3543,6 +3546,14 @@ public LogicalPlan visitShowCreateProcedure(ShowCreateProcedureContext ctx) {
         return ParserUtils.withOrigin(ctx, () -> new ShowCreateProcedureCommand(procedureName));
     }
 
+    @Override
+    public LogicalPlan visitDropCatalogRecycleBin(DropCatalogRecycleBinContext ctx) {
+        String idType = String.valueOf(ctx.idType.getText());

Review Comment:
   `ctx.idType.getText().substring(1, ctx.idType.getText().length() - 1)`
   then u will get string without quotes



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [Enhancement] (recycle bin) Support delete catalog recycle bin [doris]

Posted by "Dragonliu2018 (via GitHub)" <gi...@apache.org>.
Dragonliu2018 commented on code in PR #31893:
URL: https://github.com/apache/doris/pull/31893#discussion_r1616509391


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/DropCatalogRecycleBinStmt.java:
##########
@@ -0,0 +1,83 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.analysis;
+
+import org.apache.doris.common.AnalysisException;
+import org.apache.doris.common.UserException;
+
+/**
+ * Statement for drop a db/table/partition in catalog recycle bin.
+ */
+public class DropCatalogRecycleBinStmt extends DdlStmt {
+    private String idType;
+    private long dbId = -1;
+    private long tableId = -1;
+    private long partitionId = -1;
+
+    public DropCatalogRecycleBinStmt(String idType, long id) {
+        this.idType = idType;
+        if (idType.equals("'DbId'")) {

Review Comment:
   It would be better to be case-insensitive and not distinguish between `'` and `''`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org