git-hulk commented on code in PR #1870:
URL: https://github.com/apache/kvrocks/pull/1870#discussion_r1382409113


##########
src/commands/cmd_stream.cc:
##########
@@ -472,6 +488,82 @@ class CommandXInfo : public Commander {
 
     return Status::OK();
   }
+
+  Status getGroupInfo(Server *srv, Connection *conn, std::string *output) {
+    redis::Stream stream_db(srv->storage, conn->GetNamespace());
+    std::vector<std::pair<std::string, StreamConsumerGroupMetadata>> 
result_vector;
+    auto s = stream_db.GetGroupInfo(args_[2], result_vector);
+    if (!s.ok() && !s.IsNotFound()) {
+      return {Status::RedisExecErr, s.ToString()};
+    }
+
+    if (s.IsNotFound()) {
+      return {Status::RedisExecErr, errNoSuchKey};
+    }
+
+    if (result_vector.empty()) {
+      output->append(redis::SimpleString("(empty array)"));

Review Comment:
   For empty array should return the RESP empty array instead literal "(empty 
array)".
   
   Refer: 
https://github.com/redis/redis/blob/15a048d4f0465dc58be21d7e46d527ccfcc34a64/src/t_stream.c#L3907
   
   So Just remove this `if` block.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to