jt2594838 commented on a change in pull request #738: [IOTDB-396] New query 
clause: disable align
URL: https://github.com/apache/incubator-iotdb/pull/738#discussion_r366218327
 
 

 ##########
 File path: client/src/main/java/org/apache/iotdb/client/AbstractClient.java
 ##########
 @@ -261,28 +270,46 @@ private static void printShow(int colCount, ResultSet 
res) throws SQLException {
     println();
   }
 
-  private static void printRowData(boolean printTimestamp, ResultSet res, 
ZoneId zoneId,
+  private static void printRowData(boolean printTimestamp, boolean align, 
ResultSet res, ZoneId zoneId,
       ResultSetMetaData resultSetMetaData, int colCount)
       throws SQLException {
     if (displayCnt < maxPrintRowCount) { // NOTE displayCnt only works on 
queried data results
       print("|");
-      if (printTimestamp) {
-        printf(formatTime, formatDatetime(res.getLong(TIMESTAMP_STR), zoneId));
-        for (int i = 2; i <= colCount; i++) {
-          printColumnData(resultSetMetaData, res, i, zoneId);
+      if (align) {
+        if (printTimestamp) {
+          printf(formatTime, formatDatetime(res.getLong(TIMESTAMP_STR), 
zoneId));
+          for (int i = 2; i <= colCount; i++) {
+            printColumnData(resultSetMetaData, align, res, i, zoneId);
+          }
+        } else {
+          for (int i = 1; i <= colCount; i++) {
+            printColumnData(resultSetMetaData, align, res, i, zoneId);
+          }
         }
-      } else {
-        for (int i = 1; i <= colCount; i++) {
-          printf(formatValue, res.getString(i));
+      }
+      else {
+        for (int i = 2; i <= colCount / 2 + 1; i++) {
+          if (printTimestamp) {
+            // timeLabel used for indicating the time column.
+            String timeLabel = TIMESTAMP_STR + 
resultSetMetaData.getColumnLabel(2 * i - 2);
+            if (res.getLong(timeLabel) == 0) {
+              // blank space
+              printf(formatTime, "");
 
 Review comment:
   If the timestamp is truly a "0", will it be translated into space? If so, I 
don't think it is reasonable.

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


With regards,
Apache Git Services

Reply via email to