From ebfcba11b00f5f3a8b4fa9a2ec08d3fc69808c68 Mon Sep 17 00:00:00 2001
From: moneytoyang <54361828+moneytoyang@users.noreply.github.com>
Date: Wed, 4 Sep 2019 15:15:17 +0800
Subject: [PATCH] Improved displaying in nebula console (#829)

---
 src/console/CmdProcessor.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/console/CmdProcessor.cpp b/src/console/CmdProcessor.cpp
index e40edf49..f5d6cadf 100644
--- a/src/console/CmdProcessor.cpp
+++ b/src/console/CmdProcessor.cpp
@@ -338,12 +338,16 @@ void CmdProcessor::processServerCmd(folly::StringPiece cmd) {
         } else {
             curSpaceName_ = "(none)";
         }
-        printResult(resp);
-        if (resp.get_rows() != nullptr) {
+        if (resp.get_rows() && !resp.get_rows()->empty()) {
+            printResult(resp);
             std::cout << "Got " << resp.get_rows()->size()
                       << " rows (Time spent: "
                       << resp.get_latency_in_us() << "/"
                       << dur.elapsedInUSec() << " us)\n";
+        } else if (resp.get_rows()) {
+            std::cout << "Empty set (Time spent: "
+                      << resp.get_latency_in_us() << "/"
+                      << dur.elapsedInUSec() << " us)\n";
         } else {
             std::cout << "Execution succeeded (Time spent: "
                       << resp.get_latency_in_us() << "/"
-- 
GitLab