You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2022/11/18 02:34:10 UTC

[iotdb] branch master updated: [IOTDB-4973] add a copy of time instead of calling getTimestamp

This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 9cdab6e955 [IOTDB-4973] add a copy of time instead of calling getTimestamp
9cdab6e955 is described below

commit 9cdab6e955016f1a44a4bf9312ea6c72d503ed4b
Author: YangCaiyin <yc...@gmail.com>
AuthorDate: Fri Nov 18 10:34:05 2022 +0800

    [IOTDB-4973] add a copy of time instead of calling getTimestamp
---
 .../src/main/java/org/apache/iotdb/rpc/IoTDBRpcDataSet.java    | 10 ++--------
 .../src/main/java/org/apache/iotdb/session/SessionDataSet.java |  2 +-
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/service-rpc/src/main/java/org/apache/iotdb/rpc/IoTDBRpcDataSet.java b/service-rpc/src/main/java/org/apache/iotdb/rpc/IoTDBRpcDataSet.java
index 5e78af7bce..58a32f5e95 100644
--- a/service-rpc/src/main/java/org/apache/iotdb/rpc/IoTDBRpcDataSet.java
+++ b/service-rpc/src/main/java/org/apache/iotdb/rpc/IoTDBRpcDataSet.java
@@ -62,6 +62,7 @@ public class IoTDBRpcDataSet {
   public long sessionId;
   public long queryId;
   public long statementId;
+  public long time;
   public boolean ignoreTimeStamp;
   // indicates that there is still more data in server side and we can call fetchResult to get more
   public boolean moreData;
@@ -331,6 +332,7 @@ public class IoTDBRpcDataSet {
   public void constructOneRow() {
     tsBlockIndex++;
     hasCachedRecord = true;
+    time = curTsBlock.getTimeColumn().getLong(tsBlockIndex);
   }
 
   public void constructOneTsBlock() {
@@ -497,10 +499,6 @@ public class IoTDBRpcDataSet {
     return getTimestamp(findColumn(columnName));
   }
 
-  public Timestamp getTimestamp() throws StatementExecutionException {
-    return new Timestamp(curTsBlock.getTimeByIndex(tsBlockIndex));
-  }
-
   public int findColumn(String columnName) {
     return columnOrdinalMap.get(columnName);
   }
@@ -549,10 +547,6 @@ public class IoTDBRpcDataSet {
       return null;
     }
     lastReadWasNull = false;
-    return getObject(index, columnTypeDeduplicatedList.get(index));
-  }
-
-  public Object getObject(int index, TSDataType tsDataType) {
     return curTsBlock.getColumn(index).getObject(tsBlockIndex);
   }
 
diff --git a/session/src/main/java/org/apache/iotdb/session/SessionDataSet.java b/session/src/main/java/org/apache/iotdb/session/SessionDataSet.java
index c07336bb36..55c6d4b5fb 100644
--- a/session/src/main/java/org/apache/iotdb/session/SessionDataSet.java
+++ b/session/src/main/java/org/apache/iotdb/session/SessionDataSet.java
@@ -173,7 +173,7 @@ public class SessionDataSet implements AutoCloseable {
       }
       outFields.add(field);
     }
-    return new RowRecord(ioTDBRpcDataSet.getTimestamp().getTime(), outFields);
+    return new RowRecord(ioTDBRpcDataSet.time, outFields);
   }
 
   public RowRecord next() throws StatementExecutionException, IoTDBConnectionException {