xuzifu666 commented on code in PR #4893: URL: https://github.com/apache/paimon/pull/4893#discussion_r1928094732
########## paimon-flink/paimon-flink-1.18/src/main/java/org/apache/paimon/flink/procedure/ClearConsumersProcedure.java: ########## @@ -0,0 +1,97 @@ +/* + * 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.paimon.flink.procedure; + +import org.apache.paimon.catalog.Catalog; +import org.apache.paimon.catalog.Identifier; +import org.apache.paimon.consumer.ConsumerManager; +import org.apache.paimon.table.FileStoreTable; + +import org.apache.flink.table.procedure.ProcedureContext; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + +/** + * Clear consumers procedure. Usage: + * + * <pre><code> + * -- clear all consumers except the specified consumer in the table + * CALL sys.clear_consumers('tableId', 'consumerIds', true) + * + * -- clear all specified consumers in the table + * CALL sys.clear_consumers('tableId', 'consumerIds') or CALL sys.clear_consumers('tableId', 'consumerIds', false) Review Comment: OK,I mean that reset_consumer('c1') would delete c1 consumer, if want to delete mutiple consumers, can extend as reset_consumer('c1,c2,c3') if just want to batch delete consumers , this is just my suggestion. but you had add 2 new params include and exclude also can consider about others suggestion~ ########## docs/content/flink/procedures.md: ########## @@ -388,6 +388,31 @@ All available procedures are listed below. </td> <td>CALL sys.reset_consumer(`table` => 'default.T', consumer_id => 'myid', next_snapshot_id => cast(10 as bigint))</td> </tr> + <tr> + <td>clear_consumers</td> + <td> + -- Use named argument<br/> + CALL [catalog.]sys.clear_consumers(`table` => 'identifier', including_consumers => 'includingConsumers', excluding_consumers => 'excludingConsumers') <br/><br/> Review Comment: OK,I mean that reset_consumer('c1') would delete c1 consumer, if want to delete mutiple consumers, can extend as reset_consumer('c1,c2,c3') if just want to batch delete consumers , this is just my suggestion. but you had add 2 new params include and exclude also can consider about others suggestion~ -- 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: issues-unsubscr...@paimon.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org