ijuma commented on a change in pull request #10371:
URL: https://github.com/apache/kafka/pull/10371#discussion_r598744129



##########
File path: core/src/main/scala/kafka/admin/ConsumerGroupCommand.scala
##########
@@ -708,30 +711,35 @@ object ConsumerGroupCommand extends Logging {
       options.timeoutMs(t)
     }
 
-    private def parseTopicPartitionsToReset(groupId: String, topicArgs: 
Seq[String]): Seq[TopicPartition] = topicArgs.flatMap {
-      case topicArg if topicArg.contains(":") =>
-        val topicPartitions = topicArg.split(":")
+    private def parseTopicPartitionsToReset(topicArgs: Seq[String]): 
Seq[TopicPartition] = {
+      val (topicsWithPartitions, topics) = topicArgs.partition(_.contains(":"))
+      val specifiedPartitions = topicsWithPartitions.flatMap { arg =>
+        val topicPartitions = arg.split(":")

Review comment:
       This is not great on its own since the error will be cryptic. It's ok to 
use the pattern match, but you would want to handle the case where it doesn't 
match with an appropriate error message.




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

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


Reply via email to