You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2020/05/20 01:03:53 UTC

[GitHub] [incubator-iotdb] SilverNarcissus opened a new pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

SilverNarcissus opened a new pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229


   Use binary rather than string in insert plan


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-iotdb] sonarcloud[bot] removed a comment on pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] removed a comment on pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229#issuecomment-632217380


   SonarCloud Quality Gate failed.
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=SECURITY_HOTSPOT) [5 Security Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=SECURITY_HOTSPOT) to review)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=CODE_SMELL) [9 Code Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=1229) No Coverage information  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10.png' alt='9.9%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=1229&metric=new_duplicated_lines_density&view=list) [9.9% Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=1229&metric=new_duplicated_lines_density&view=list)
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-iotdb] HTHou commented on a change in pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

Posted by GitBox <gi...@apache.org>.
HTHou commented on a change in pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229#discussion_r429704349



##########
File path: service-rpc/rpc-changelist.md
##########
@@ -121,3 +121,34 @@ Last Updated on 2019-10-27 by Lei Rui.
 | Add required i64 statementId in TSExecuteStatementReq        | Yuan Tian |
 | Add required binary time, required list<binary> valueList, required list<binary> bitmapList and remove required binary values, required i32 rowCount in TSQueryDataSet| Yuan Tian |
 | Add optional i32 fetchSize in TSExecuteStatementReq,<br />Add optional TSQueryDataSet in TSExecuteStatementResp| liutaohua |
+| Add optional map<string, string> props, optional map<string, string> tags, optional map<string, string> attributes and optional string aliasPath in TSCreateTimeseriesReq | Yuan Tian | 
+
+
+# 0.10.0 (version-1) -> version-2
+
+Last Updated on November 12th, 2019 by Tian Jiang.
+
+
+## 1. Delete Old
+
+| Latest Changes                     | Related Committers |
+| ---------------------------------- | ------------------ |
+| Remove TS_SessionHandle,TSHandleIdentifier            | Tian Jiang         |
+| Remove TSStatus,TSExecuteInsertRowInBatchResp            | Jialin Qiao|
+
+## 2. Add New
+
+| Latest Changes                                               | Related Committers                 |
+| ------------------------------------------------------------ | ---------------------------------- |
+| Add parameter sessionId in getTimeZone, getProperties, setStorageGroup, createTimeseries... | Tian Jiang|
+| Add struct TSQueryNonAlignDataSet                            | Haonan Hou|
+
+## 3. Update
+
+| Latest Changes                                               | Related Committers     |
+| ------------------------------------------------------------ | ---------------------- |
+| Replace TS_SessionHandles with SessionIds, TSOperationHandle with queryIds  | Tian Jiang  |
+| Add optional TSQueryNonAlignDataSet in TSExecuteStatementResp, TSFetchResultsResp and required bool isAlign in TSFetchResultsReq | Haonan Hou |
+| Rename TSStatusType to TSStatus   | Jialin Qiao   |
+| Remove sessionId in TSExecuteBatchStatementResp   | Jialin Qiao   |
+| Use TsDataType and binary rather than string in TSInsertInBatchReq and TSInsertReq  | Kaifeng Xue  |

Review comment:
       Move this line to line 53.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-iotdb] qiaojialin merged pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

Posted by GitBox <gi...@apache.org>.
qiaojialin merged pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-iotdb] qiaojialin commented on a change in pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

Posted by GitBox <gi...@apache.org>.
qiaojialin commented on a change in pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229#discussion_r427759977



##########
File path: example/rocketmq/src/main/java/org/apache/iotdb/rocketmq/RocketMQConsumer.java
##########
@@ -89,8 +90,37 @@ private void insert(String data) throws IoTDBConnectionException, StatementExecu
     String device = dataArray[0];
     long time = Long.parseLong(dataArray[1]);
     List<String> measurements = Arrays.asList(dataArray[2].split(":"));
-    List<String> values = Arrays.asList(dataArray[3].split(":"));
-    session.insertRecord(device, time, measurements, values);
+    List<TSDataType> types = new ArrayList<>();

Review comment:
       The format of message is changed, the example data should also be changed
   
   example/rocketmq/src/main/java/org/apache/iotdb/rocketmq/Constant.java

##########
File path: service-rpc/rpc-changelist.md
##########
@@ -121,3 +121,35 @@ Last Updated on 2019-10-27 by Lei Rui.
 | Add required i64 statementId in TSExecuteStatementReq        | Yuan Tian |
 | Add required binary time, required list<binary> valueList, required list<binary> bitmapList and remove required binary values, required i32 rowCount in TSQueryDataSet| Yuan Tian |
 | Add optional i32 fetchSize in TSExecuteStatementReq,<br />Add optional TSQueryDataSet in TSExecuteStatementResp| liutaohua |
+<<<<<<< HEAD

Review comment:
       remove this

##########
File path: server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertPlan.java
##########
@@ -174,8 +234,102 @@ public void serializeTo(DataOutputStream stream) throws IOException {
       schema.serializeTo(stream);
     }
 
-    for (String m : values) {
-      putString(stream, m);
+    try {
+      putValues(stream);
+    } catch (QueryProcessException e) {
+      throw new IOException(e);
+    }
+  }
+
+  private void putValues(DataOutputStream outputStream) throws QueryProcessException, IOException {
+    for (int i = 0; i < values.length; i++) {
+      ReadWriteIOUtils.write(types[i], outputStream);
+      switch (types[i]) {
+        case BOOLEAN:
+          ReadWriteIOUtils.write((Boolean) values[i], outputStream);
+          break;
+        case INT32:
+          ReadWriteIOUtils.write((Integer) values[i], outputStream);
+          break;
+        case INT64:
+          ReadWriteIOUtils.write((Long) values[i], outputStream);
+          break;
+        case FLOAT:
+          ReadWriteIOUtils.write((Float) values[i], outputStream);
+          break;
+        case DOUBLE:
+          ReadWriteIOUtils.write((Double) values[i], outputStream);
+          break;
+        case TEXT:
+          ReadWriteIOUtils.write((Binary) values[i], outputStream);
+          break;
+        default:
+          throw new QueryProcessException("Unsupported data type:" + types[i]);
+      }
+    }
+  }
+
+  private void putValues(ByteBuffer buffer) throws QueryProcessException {
+    for (int i = 0; i < values.length; i++) {
+      ReadWriteIOUtils.write(types[i], buffer);
+      switch (types[i]) {
+        case BOOLEAN:
+          ReadWriteIOUtils.write((Boolean) values[i], buffer);
+          break;
+        case INT32:
+          ReadWriteIOUtils.write((Integer) values[i], buffer);
+          break;
+        case INT64:
+          ReadWriteIOUtils.write((Long) values[i], buffer);
+          break;
+        case FLOAT:
+          ReadWriteIOUtils.write((Float) values[i], buffer);
+          break;
+        case DOUBLE:
+          ReadWriteIOUtils.write((Double) values[i], buffer);
+          break;
+        case TEXT:
+          ReadWriteIOUtils.write((Binary) values[i], buffer);
+          break;
+        default:
+          throw new QueryProcessException("Unsupported data type:" + types[i]);
+      }
+    }
+  }
+
+  public TSDataType[] getTypes() {
+    return types;
+  }
+
+  public void setTypes(TSDataType[] types) {
+    this.types = types;
+  }
+
+  public void getValues(ByteBuffer buffer) throws QueryProcessException {

Review comment:
       setValues

##########
File path: example/session/src/main/java/org/apache/iotdb/SessionExample.java
##########
@@ -168,32 +178,47 @@ private static void insertRecords() throws IoTDBConnectionException, BatchExecut
     measurements.add("s3");
     List<String> deviceIds = new ArrayList<>();
     List<List<String>> measurementsList = new ArrayList<>();
-    List<List<String>> valuesList = new ArrayList<>();
+    List<List<Object>> valuesList = new ArrayList<>();
     List<Long> timestamps = new ArrayList<>();
+    List<List<TSDataType>> typesList = new ArrayList<>();
 
     for (long time = 0; time < 500; time++) {
-      List<String> values = new ArrayList<>();
-      values.add("1");
-      values.add("2");
-      values.add("3");
+      List<Object> values = new ArrayList<>();
+      List<TSDataType> types = new ArrayList<>();
+      values.add(1L);
+      values.add(2L);
+      values.add(3L);
+      types.add(TSDataType.INT64);
+      types.add(TSDataType.INT64);
+      types.add(TSDataType.INT64);
 
       deviceIds.add(deviceId);
       measurementsList.add(measurements);
       valuesList.add(values);
+      typesList.add(types);
       timestamps.add(time);
       if (time != 0 && time % 100 == 0) {
-        session.insertRecords(deviceIds, timestamps, measurementsList, valuesList);
+        session.insertRecords(deviceIds, timestamps, measurementsList, typesList, valuesList);
         deviceIds.clear();
         measurementsList.clear();
         valuesList.clear();
         timestamps.clear();
       }
     }
 
-    session.insertRecords(deviceIds, timestamps, measurementsList, valuesList);
+    session.insertRecords(deviceIds, timestamps, measurementsList, typesList, valuesList);
   }
-
   /**
+<<<<<<< HEAD
+   * insert a batch data of one device, each batch contains multiple timestamps with values of
+   * sensors
+   * <p>
+   * a RowBatch example:
+   * <p>
+   * device1 time s1, s2, s3 1,   1,  1,  1 2,   2,  2,  2 3,   3,  3,  3
+   * <p>
+   * Users need to control the count of RowBatch and write a batch when it reaches the maxBatchSize
+=======

Review comment:
       remove

##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -215,66 +218,29 @@ private boolean reconnect() {
   }
 
   /**
-   * insert data in one row, if you want to improve your performance, please use insertRecords method
-   * or insertTablet method
+   * insert data in one row, if you want to improve your performance, please use insertRecords
+   * method or insertTablet method
    *
-   * @see Session#insertRecords(List, List, List, List)
+   * @see Session#insertRecords(List, List, List, List, List)
    * @see Session#insertTablet(Tablet)
    */
   public void insertRecord(String deviceId, long time, List<String> measurements,
+      List<TSDataType> types,

Review comment:
       Could we refer type from values.class and omit this types

##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -215,66 +218,29 @@ private boolean reconnect() {
   }
 
   /**
-   * insert data in one row, if you want to improve your performance, please use insertRecords method
-   * or insertTablet method
+   * insert data in one row, if you want to improve your performance, please use insertRecords
+   * method or insertTablet method
    *
-   * @see Session#insertRecords(List, List, List, List)
+   * @see Session#insertRecords(List, List, List, List, List)
    * @see Session#insertTablet(Tablet)
    */
   public void insertRecord(String deviceId, long time, List<String> measurements,
+      List<TSDataType> types,
       Object... values) throws IoTDBConnectionException, StatementExecutionException {
-    List<String> stringValues = new ArrayList<>();
-    for (Object o : values) {
-      stringValues.add(o.toString());
-    }
+    List<Object> valuesList = new ArrayList<>(Arrays.asList(values));
 
-    insertRecord(deviceId, time, measurements, stringValues);
+    insertRecord(deviceId, time, measurements, types, valuesList);
   }
 
-  /**
-   * insert data in one row, if you want to improve your performance, please use insertRecords method
-   * or insertTablet method
-   *
-   * @see Session#insertRecords(List, List, List, List)
-   * @see Session#insertTablet(Tablet)
-   */
-  public void insertRecord(String deviceId, long time, List<String> measurements,

Review comment:
       we'd better add back the List<String> values interface

##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -215,66 +218,29 @@ private boolean reconnect() {
   }
 
   /**
-   * insert data in one row, if you want to improve your performance, please use insertRecords method
-   * or insertTablet method
+   * insert data in one row, if you want to improve your performance, please use insertRecords
+   * method or insertTablet method
    *
-   * @see Session#insertRecords(List, List, List, List)
+   * @see Session#insertRecords(List, List, List, List, List)
    * @see Session#insertTablet(Tablet)
    */
   public void insertRecord(String deviceId, long time, List<String> measurements,
+      List<TSDataType> types,
       Object... values) throws IoTDBConnectionException, StatementExecutionException {
-    List<String> stringValues = new ArrayList<>();
-    for (Object o : values) {
-      stringValues.add(o.toString());
-    }
+    List<Object> valuesList = new ArrayList<>(Arrays.asList(values));
 
-    insertRecord(deviceId, time, measurements, stringValues);
+    insertRecord(deviceId, time, measurements, types, valuesList);
   }
 
-  /**
-   * insert data in one row, if you want to improve your performance, please use insertRecords method
-   * or insertTablet method
-   *
-   * @see Session#insertRecords(List, List, List, List)
-   * @see Session#insertTablet(Tablet)
-   */
-  public void insertRecord(String deviceId, long time, List<String> measurements,
-      List<String> values) throws IoTDBConnectionException, StatementExecutionException {
-    TSInsertRecordReq request = new TSInsertRecordReq();
-    request.setSessionId(sessionId);
-    request.setDeviceId(deviceId);
-    request.setTimestamp(time);
-    request.setMeasurements(measurements);
-    request.setValues(values);
-
-    try {
-      RpcUtils.verifySuccess(client.insertRecord(request));
-    } catch (TException e) {
-      if (reconnect()) {
-        try {
-          RpcUtils.verifySuccess(client.insertRecord(request));
-        } catch (TException e1) {
-          throw new IoTDBConnectionException(e1);
-        }
-      } else {
-        throw new IoTDBConnectionException("Fail to reconnect to server,"
-            + " please check server status", e);
-      }
-    }
-  }
 
 
   /**
    * insert the data of a device. For each timestamp, the number of measurements is the same.
-   *
-   *  a Tablet example:
-   *
-   *        device1
-   *     time s1, s2, s3
-   *     1,   1,  1,  1
-   *     2,   2,  2,  2
-   *     3,   3,  3,  3
-   *
+   * <p>
+   * a Tablet example:
+   * <p>
+   * device1 time s1, s2, s3 1,   1,  1,  1 2,   2,  2,  2 3,   3,  3,  3
+   * <p>

Review comment:
       format back

##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -215,66 +218,29 @@ private boolean reconnect() {
   }
 
   /**
-   * insert data in one row, if you want to improve your performance, please use insertRecords method
-   * or insertTablet method
+   * insert data in one row, if you want to improve your performance, please use insertRecords
+   * method or insertTablet method
    *
-   * @see Session#insertRecords(List, List, List, List)
+   * @see Session#insertRecords(List, List, List, List, List)
    * @see Session#insertTablet(Tablet)
    */
   public void insertRecord(String deviceId, long time, List<String> measurements,
+      List<TSDataType> types,
       Object... values) throws IoTDBConnectionException, StatementExecutionException {

Review comment:
       Why not use List<Object> directly

##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -393,16 +359,17 @@ public void insertTablets(Map<String, Tablet> tablets, boolean sorted)
   }
 
   /**
-   * Insert multiple rows, which can reduce the overhead of network. This method is just like
-   * jdbc executeBatch, we pack some insert request in batch and send them to server.
-   * If you want improve your performance, please see insertTablet method
-   *
+   * Insert multiple rows, which can reduce the overhead of network. This method is just like jdbc
+   * executeBatch, we pack some insert request in batch and send them to server. If you want improve
+   * your performance, please see insertTablet method
+   * <p>
    * Each row is independent, which could have different deviceId, time, number of measurements
    *
    * @see Session#insertTablet(Tablet)
    */
   public void insertRecords(List<String> deviceIds, List<Long> times,
-      List<List<String>> measurementsList, List<List<String>> valuesList)
+      List<List<String>> measurementsList, List<List<TSDataType>> typesList,
+      List<List<Object>> valuesList)

Review comment:
       We could provide two types of interfaces:
   List\<TSDataType\> + List\<String\>
   or
   List\<Object\>

##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -434,26 +408,103 @@ public void insertRecords(List<String> deviceIds, List<Long> times,
     }
   }
 
+
   /**
-   * This method NOT insert data into database and the server just return after accept the request,
-   * this method should be used to test other time cost in client
+   * insert data in one row, if you want improve your performance, please use insertInBatch method
+   * or insertBatch method
+   *
+   * @see Session#insertRecords(List, List, List, List, List)
+   * @see Session#insertTablet(Tablet)
    */
-  public void testInsertRecord(String deviceId, long time, List<String> measurements,
-      List<String> values) throws IoTDBConnectionException, StatementExecutionException {
+  public void insertRecord(String deviceId, long time, List<String> measurements,
+      List<TSDataType> types,
+      List<Object> values) throws IoTDBConnectionException, StatementExecutionException {
     TSInsertRecordReq request = new TSInsertRecordReq();
     request.setSessionId(sessionId);
     request.setDeviceId(deviceId);
     request.setTimestamp(time);
     request.setMeasurements(measurements);
-    request.setValues(values);
+    ByteBuffer buffer = ByteBuffer.allocate(calculateLength(types, values));
+    putValues(types, values, buffer);
+    buffer.flip();
+    request.setValues(buffer);
 
     try {
-      RpcUtils.verifySuccess(client.testInsertRecord(request));
+      RpcUtils.verifySuccess(client.insertRecord(request));
     } catch (TException e) {
       throw new IoTDBConnectionException(e);
     }
   }
 
+  /**
+   * put value in buffer
+   * @param types types list
+   * @param values values list
+   * @param buffer buffer to insert
+   * @throws IoTDBConnectionException
+   */
+  private void putValues(List<TSDataType> types, List<Object> values, ByteBuffer buffer)
+      throws IoTDBConnectionException {
+    for (int i = 0; i < values.size(); i++) {
+      ReadWriteIOUtils.write(types.get(i), buffer);
+      switch (types.get(i)) {
+        case BOOLEAN:
+          ReadWriteIOUtils.write((Boolean) values.get(i), buffer);
+          break;
+        case INT32:
+          ReadWriteIOUtils.write((Integer) values.get(i), buffer);
+          break;
+        case INT64:
+          ReadWriteIOUtils.write((Long) values.get(i), buffer);
+          break;
+        case FLOAT:
+          ReadWriteIOUtils.write((Float) values.get(i), buffer);
+          break;
+        case DOUBLE:
+          ReadWriteIOUtils.write((Double) values.get(i), buffer);
+          break;
+        case TEXT:
+          ReadWriteIOUtils.write(new Binary((String) values.get(i)), buffer);

Review comment:
       no need to construct a Binary, s.getBytes(TSFileConfig.STRING_CHARSET) is ok

##########
File path: server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
##########
@@ -1066,15 +1066,22 @@ public TSExecuteBatchStatementResp insertRecords(TSInsertRecordsReq req) {
 
     InsertPlan plan = new InsertPlan();
     for (int i = 0; i < req.deviceIds.size(); i++) {
-      plan.setDeviceId(req.getDeviceIds().get(i));
-      plan.setTime(req.getTimestamps().get(i));
-      plan.setMeasurements(req.getMeasurementsList().get(i).toArray(new String[0]));
-      plan.setValues(req.getValuesList().get(i).toArray(new String[0]));
-      TSStatus status = checkAuthority(plan, req.getSessionId());
-      if (status != null) {
-        resp.addToStatusList(status);
-      } else {
-        resp.addToStatusList(executePlan(plan));
+      try {
+        plan.setDeviceId(req.getDeviceIds().get(i));
+        plan.setTime(req.getTimestamps().get(i));
+        plan.setMeasurements(req.getMeasurementsList().get(i).toArray(new String[0]));
+        plan.setTypes(new TSDataType[plan.getMeasurements().length]);
+        plan.setValues(new Object[plan.getMeasurements().length]);
+        plan.getValues(req.valuesList.get(i));
+        TSStatus status = checkAuthority(plan, req.getSessionId());
+        if (status != null) {
+          resp.addToStatusList(status);
+        } else {
+          resp.addToStatusList(executePlan(plan));
+        }
+      }
+      catch (Exception e) {
+        logger.error("meet error when insert in batch", e);

Review comment:
       add an error status for this line

##########
File path: example/session/src/main/java/org/apache/iotdb/SessionExample.java
##########
@@ -168,32 +178,47 @@ private static void insertRecords() throws IoTDBConnectionException, BatchExecut
     measurements.add("s3");
     List<String> deviceIds = new ArrayList<>();
     List<List<String>> measurementsList = new ArrayList<>();
-    List<List<String>> valuesList = new ArrayList<>();
+    List<List<Object>> valuesList = new ArrayList<>();
     List<Long> timestamps = new ArrayList<>();
+    List<List<TSDataType>> typesList = new ArrayList<>();
 
     for (long time = 0; time < 500; time++) {
-      List<String> values = new ArrayList<>();
-      values.add("1");
-      values.add("2");
-      values.add("3");
+      List<Object> values = new ArrayList<>();
+      List<TSDataType> types = new ArrayList<>();
+      values.add(1L);
+      values.add(2L);
+      values.add(3L);
+      types.add(TSDataType.INT64);
+      types.add(TSDataType.INT64);
+      types.add(TSDataType.INT64);
 
       deviceIds.add(deviceId);
       measurementsList.add(measurements);
       valuesList.add(values);
+      typesList.add(types);
       timestamps.add(time);
       if (time != 0 && time % 100 == 0) {
-        session.insertRecords(deviceIds, timestamps, measurementsList, valuesList);
+        session.insertRecords(deviceIds, timestamps, measurementsList, typesList, valuesList);
         deviceIds.clear();
         measurementsList.clear();
         valuesList.clear();
         timestamps.clear();
       }
     }
 
-    session.insertRecords(deviceIds, timestamps, measurementsList, valuesList);
+    session.insertRecords(deviceIds, timestamps, measurementsList, typesList, valuesList);
   }
-
   /**
+<<<<<<< HEAD

Review comment:
       remove this

##########
File path: server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
##########
@@ -1111,7 +1118,9 @@ public TSStatus insertRecord(TSInsertRecordReq req) {
       plan.setDeviceId(req.getDeviceId());
       plan.setTime(req.getTimestamp());
       plan.setMeasurements(req.getMeasurements().toArray(new String[0]));
-      plan.setValues(req.getValues().toArray(new String[0]));
+      plan.setTypes(new TSDataType[plan.getMeasurements().length]);
+      plan.setValues(new Object[plan.getMeasurements().length]);
+      plan.getValues(req.values);

Review comment:
       ```suggestion
         plan.setValues(req.values);
   ```

##########
File path: example/session/src/main/java/org/apache/iotdb/SessionExample.java
##########
@@ -205,6 +230,7 @@ private static void insertRecords() throws IoTDBConnectionException, BatchExecut
    * 3,   3,  3,  3
    *
    * Users need to control the count of Tablet and write a batch when it reaches the maxBatchSize
+>>>>>>> 73dd5eb6e44e2194b650eea72aabcfaf929e5bdc

Review comment:
       remove

##########
File path: example/session/src/main/java/org/apache/iotdb/SessionExample.java
##########
@@ -168,32 +178,47 @@ private static void insertRecords() throws IoTDBConnectionException, BatchExecut
     measurements.add("s3");
     List<String> deviceIds = new ArrayList<>();
     List<List<String>> measurementsList = new ArrayList<>();
-    List<List<String>> valuesList = new ArrayList<>();
+    List<List<Object>> valuesList = new ArrayList<>();
     List<Long> timestamps = new ArrayList<>();
+    List<List<TSDataType>> typesList = new ArrayList<>();
 
     for (long time = 0; time < 500; time++) {
-      List<String> values = new ArrayList<>();
-      values.add("1");
-      values.add("2");
-      values.add("3");
+      List<Object> values = new ArrayList<>();
+      List<TSDataType> types = new ArrayList<>();
+      values.add(1L);
+      values.add(2L);
+      values.add(3L);
+      types.add(TSDataType.INT64);
+      types.add(TSDataType.INT64);
+      types.add(TSDataType.INT64);
 
       deviceIds.add(deviceId);
       measurementsList.add(measurements);
       valuesList.add(values);
+      typesList.add(types);
       timestamps.add(time);
       if (time != 0 && time % 100 == 0) {
-        session.insertRecords(deviceIds, timestamps, measurementsList, valuesList);
+        session.insertRecords(deviceIds, timestamps, measurementsList, typesList, valuesList);
         deviceIds.clear();
         measurementsList.clear();
         valuesList.clear();
         timestamps.clear();
       }
     }
 
-    session.insertRecords(deviceIds, timestamps, measurementsList, valuesList);
+    session.insertRecords(deviceIds, timestamps, measurementsList, typesList, valuesList);
   }
-
   /**
+<<<<<<< HEAD
+   * insert a batch data of one device, each batch contains multiple timestamps with values of
+   * sensors
+   * <p>
+   * a RowBatch example:
+   * <p>
+   * device1 time s1, s2, s3 1,   1,  1,  1 2,   2,  2,  2 3,   3,  3,  3

Review comment:
       format to a table 




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-iotdb] HTHou commented on a change in pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

Posted by GitBox <gi...@apache.org>.
HTHou commented on a change in pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229#discussion_r429704349



##########
File path: service-rpc/rpc-changelist.md
##########
@@ -121,3 +121,34 @@ Last Updated on 2019-10-27 by Lei Rui.
 | Add required i64 statementId in TSExecuteStatementReq        | Yuan Tian |
 | Add required binary time, required list<binary> valueList, required list<binary> bitmapList and remove required binary values, required i32 rowCount in TSQueryDataSet| Yuan Tian |
 | Add optional i32 fetchSize in TSExecuteStatementReq,<br />Add optional TSQueryDataSet in TSExecuteStatementResp| liutaohua |
+| Add optional map<string, string> props, optional map<string, string> tags, optional map<string, string> attributes and optional string aliasPath in TSCreateTimeseriesReq | Yuan Tian | 
+
+
+# 0.10.0 (version-1) -> version-2
+
+Last Updated on November 12th, 2019 by Tian Jiang.
+
+
+## 1. Delete Old
+
+| Latest Changes                     | Related Committers |
+| ---------------------------------- | ------------------ |
+| Remove TS_SessionHandle,TSHandleIdentifier            | Tian Jiang         |
+| Remove TSStatus,TSExecuteInsertRowInBatchResp            | Jialin Qiao|
+
+## 2. Add New
+
+| Latest Changes                                               | Related Committers                 |
+| ------------------------------------------------------------ | ---------------------------------- |
+| Add parameter sessionId in getTimeZone, getProperties, setStorageGroup, createTimeseries... | Tian Jiang|
+| Add struct TSQueryNonAlignDataSet                            | Haonan Hou|
+
+## 3. Update
+
+| Latest Changes                                               | Related Committers     |
+| ------------------------------------------------------------ | ---------------------- |
+| Replace TS_SessionHandles with SessionIds, TSOperationHandle with queryIds  | Tian Jiang  |
+| Add optional TSQueryNonAlignDataSet in TSExecuteStatementResp, TSFetchResultsResp and required bool isAlign in TSFetchResultsReq | Haonan Hou |
+| Rename TSStatusType to TSStatus   | Jialin Qiao   |
+| Remove sessionId in TSExecuteBatchStatementResp   | Jialin Qiao   |
+| Use TsDataType and binary rather than string in TSInsertInBatchReq and TSInsertReq  | Kaifeng Xue  |

Review comment:
       Move the line 154 to line 53.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-iotdb] SilverNarcissus commented on pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

Posted by GitBox <gi...@apache.org>.
SilverNarcissus commented on pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229#issuecomment-633423861


   > We need to keep compatible with previous versions.. so we'd better to retain the APIs that allow Strings.
   > 
   > By the way, sometimes users may do not know the detailed data type the series is on the server when they write data.
   
   Thanks~  I have add original interface back and test


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-iotdb] sonarcloud[bot] commented on pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229#issuecomment-633165449


   SonarCloud Quality Gate failed.
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=SECURITY_HOTSPOT) [5 Security Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=SECURITY_HOTSPOT) to review)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=CODE_SMELL) [9 Code Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=1229) No Coverage information  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10.png' alt='9.9%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=1229&metric=new_duplicated_lines_density&view=list) [9.9% Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=1229&metric=new_duplicated_lines_density&view=list)
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-iotdb] sonarcloud[bot] commented on pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229#issuecomment-633426978


   SonarCloud Quality Gate failed.
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=SECURITY_HOTSPOT) [5 Security Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=SECURITY_HOTSPOT) to review)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=CODE_SMELL) [11 Code Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=1229) No Coverage information  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10.png' alt='8.5%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=1229&metric=new_duplicated_lines_density&view=list) [8.5% Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=1229&metric=new_duplicated_lines_density&view=list)
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-iotdb] SilverNarcissus commented on a change in pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

Posted by GitBox <gi...@apache.org>.
SilverNarcissus commented on a change in pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229#discussion_r427795995



##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -215,66 +218,29 @@ private boolean reconnect() {
   }
 
   /**
-   * insert data in one row, if you want to improve your performance, please use insertRecords method
-   * or insertTablet method
+   * insert data in one row, if you want to improve your performance, please use insertRecords
+   * method or insertTablet method
    *
-   * @see Session#insertRecords(List, List, List, List)
+   * @see Session#insertRecords(List, List, List, List, List)
    * @see Session#insertTablet(Tablet)
    */
   public void insertRecord(String deviceId, long time, List<String> measurements,
+      List<TSDataType> types,
       Object... values) throws IoTDBConnectionException, StatementExecutionException {

Review comment:
       This method is add for some client using dynamic parameter. You can refer to https://issues.apache.org/jira/projects/IOTDB/issues/IOTDB-442?filter=allissues




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-iotdb] qiaojialin commented on a change in pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

Posted by GitBox <gi...@apache.org>.
qiaojialin commented on a change in pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229#discussion_r431563580



##########
File path: server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
##########
@@ -900,7 +903,53 @@ public void insert(InsertPlan insertPlan) throws QueryProcessException {
     }
   }
 
-  /** create timeseries with ignore PathAlreadyExistException */
+  private void checkType(InsertPlan plan, int loc, TSDataType type) {
+    plan.getTypes()[loc] = type;
+    try {
+      switch (type) {
+        case INT32:
+          if (!(plan.getValues()[loc] instanceof Integer)) {
+            plan.getValues()[loc] =
+                Integer.parseInt(((Binary) plan.getValues()[loc]).getStringValue());
+          }
+          break;
+        case INT64:
+          if (!(plan.getValues()[loc] instanceof Long)) {
+            plan.getValues()[loc] =
+                Long.parseLong(((Binary) plan.getValues()[loc]).getStringValue());
+          }
+          break;
+        case DOUBLE:
+          if (!(plan.getValues()[loc] instanceof Double)) {
+            plan.getValues()[loc] =
+                Double.parseDouble(((Binary) plan.getValues()[loc]).getStringValue());
+          }
+          break;
+        case FLOAT:
+          if (!(plan.getValues()[loc] instanceof Float)) {
+            plan.getValues()[loc] =
+                Float.parseFloat(((Binary) plan.getValues()[loc]).getStringValue());
+          }
+          break;
+        case BOOLEAN:
+          if (!(plan.getValues()[loc] instanceof Boolean)) {
+            plan.getValues()[loc] =
+                Boolean.parseBoolean(((Binary) plan.getValues()[loc]).getStringValue());
+          }
+          break;
+        case TEXT:
+          // need to do nothing
+          break;
+      }
+    }
+    catch (ClassCastException e){
+      logger.error("inconsistent type between client and server");

Review comment:
       logger more information, server type, client type

##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -215,66 +218,29 @@ private boolean reconnect() {
   }
 
   /**
-   * insert data in one row, if you want to improve your performance, please use insertRecords method
-   * or insertTablet method
+   * insert data in one row, if you want to improve your performance, please use insertRecords
+   * method or insertTablet method
    *
-   * @see Session#insertRecords(List, List, List, List)
+   * @see Session#insertRecords(List, List, List, List, List)
    * @see Session#insertTablet(Tablet)
    */
   public void insertRecord(String deviceId, long time, List<String> measurements,
+      List<TSDataType> types,
       Object... values) throws IoTDBConnectionException, StatementExecutionException {
-    List<String> stringValues = new ArrayList<>();
-    for (Object o : values) {
-      stringValues.add(o.toString());
-    }
+    List<Object> valuesList = new ArrayList<>(Arrays.asList(values));
 
-    insertRecord(deviceId, time, measurements, stringValues);
+    insertRecord(deviceId, time, measurements, types, valuesList);
   }
 
-  /**
-   * insert data in one row, if you want to improve your performance, please use insertRecords method
-   * or insertTablet method
-   *
-   * @see Session#insertRecords(List, List, List, List)
-   * @see Session#insertTablet(Tablet)
-   */
-  public void insertRecord(String deviceId, long time, List<String> measurements,

Review comment:
       public void insertRecord(String deviceId, long time, List<String> measurements, List<String> values)




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-iotdb] SilverNarcissus commented on a change in pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

Posted by GitBox <gi...@apache.org>.
SilverNarcissus commented on a change in pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229#discussion_r427797451



##########
File path: server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
##########
@@ -1066,15 +1066,22 @@ public TSExecuteBatchStatementResp insertRecords(TSInsertRecordsReq req) {
 
     InsertPlan plan = new InsertPlan();
     for (int i = 0; i < req.deviceIds.size(); i++) {
-      plan.setDeviceId(req.getDeviceIds().get(i));
-      plan.setTime(req.getTimestamps().get(i));
-      plan.setMeasurements(req.getMeasurementsList().get(i).toArray(new String[0]));
-      plan.setValues(req.getValuesList().get(i).toArray(new String[0]));
-      TSStatus status = checkAuthority(plan, req.getSessionId());
-      if (status != null) {
-        resp.addToStatusList(status);
-      } else {
-        resp.addToStatusList(executePlan(plan));
+      try {
+        plan.setDeviceId(req.getDeviceIds().get(i));
+        plan.setTime(req.getTimestamps().get(i));
+        plan.setMeasurements(req.getMeasurementsList().get(i).toArray(new String[0]));
+        plan.setTypes(new TSDataType[plan.getMeasurements().length]);
+        plan.setValues(new Object[plan.getMeasurements().length]);
+        plan.getValues(req.valuesList.get(i));
+        TSStatus status = checkAuthority(plan, req.getSessionId());
+        if (status != null) {
+          resp.addToStatusList(status);
+        } else {
+          resp.addToStatusList(executePlan(plan));
+        }
+      }
+      catch (Exception e) {
+        logger.error("meet error when insert in batch", e);

Review comment:
       The status has been set to the resp at 
   ```
   resp.addToStatusList(executePlan(plan));
   ```




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-iotdb] SilverNarcissus commented on a change in pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

Posted by GitBox <gi...@apache.org>.
SilverNarcissus commented on a change in pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229#discussion_r429773521



##########
File path: example/rocketmq/src/main/java/org/apache/iotdb/rocketmq/RocketMQConsumer.java
##########
@@ -89,8 +90,37 @@ private void insert(String data) throws IoTDBConnectionException, StatementExecu
     String device = dataArray[0];
     long time = Long.parseLong(dataArray[1]);
     List<String> measurements = Arrays.asList(dataArray[2].split(":"));
-    List<String> values = Arrays.asList(dataArray[3].split(":"));
-    session.insertRecord(device, time, measurements, values);
+    List<TSDataType> types = new ArrayList<>();
+    for(String type : dataArray[3].split(":")){

Review comment:
       fixed~

##########
File path: example/rocketmq/src/main/java/org/apache/iotdb/rocketmq/RocketMQConsumer.java
##########
@@ -89,8 +90,37 @@ private void insert(String data) throws IoTDBConnectionException, StatementExecu
     String device = dataArray[0];
     long time = Long.parseLong(dataArray[1]);
     List<String> measurements = Arrays.asList(dataArray[2].split(":"));
-    List<String> values = Arrays.asList(dataArray[3].split(":"));
-    session.insertRecord(device, time, measurements, values);
+    List<TSDataType> types = new ArrayList<>();
+    for(String type : dataArray[3].split(":")){
+      types.add(TSDataType.valueOf(type));
+    }
+
+    List<Object> values = new ArrayList<>();
+    String[] valuesStr = dataArray[4].split(":");
+    for(int i = 0; i < valuesStr.length; i++){

Review comment:
       fixed~

##########
File path: example/rocketmq/src/main/java/org/apache/iotdb/rocketmq/RocketMQConsumer.java
##########
@@ -89,8 +90,37 @@ private void insert(String data) throws IoTDBConnectionException, StatementExecu
     String device = dataArray[0];
     long time = Long.parseLong(dataArray[1]);
     List<String> measurements = Arrays.asList(dataArray[2].split(":"));
-    List<String> values = Arrays.asList(dataArray[3].split(":"));
-    session.insertRecord(device, time, measurements, values);
+    List<TSDataType> types = new ArrayList<>();
+    for(String type : dataArray[3].split(":")){
+      types.add(TSDataType.valueOf(type));
+    }
+
+    List<Object> values = new ArrayList<>();
+    String[] valuesStr = dataArray[4].split(":");
+    for(int i = 0; i < valuesStr.length; i++){
+      switch (types.get(i)){

Review comment:
       fixed~

##########
File path: flink-iotdb-connector/src/main/java/org/apache/iotdb/flink/DefaultIoTSerializationSchema.java
##########
@@ -49,12 +52,37 @@ public Event serialize(Map<String,String> tuple) {
             measurements = Arrays.asList(tuple.get(fieldMeasurements).split(separator));
         }
 
-        List<String> values = null;
-        if (tuple.get(fieldValues) != null) {
-            values = Arrays.asList(tuple.get(fieldValues).split(separator));
+        List<TSDataType> types = new ArrayList<>();
+        for(String type : tuple.get(fieldTypes).split(separator)){

Review comment:
       fixed~




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-iotdb] sonarcloud[bot] removed a comment on pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] removed a comment on pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229#issuecomment-633165449


   SonarCloud Quality Gate failed.
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=SECURITY_HOTSPOT) [5 Security Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=SECURITY_HOTSPOT) to review)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=CODE_SMELL) [9 Code Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=1229) No Coverage information  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10.png' alt='9.9%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=1229&metric=new_duplicated_lines_density&view=list) [9.9% Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=1229&metric=new_duplicated_lines_density&view=list)
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-iotdb] SilverNarcissus commented on a change in pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

Posted by GitBox <gi...@apache.org>.
SilverNarcissus commented on a change in pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229#discussion_r427800901



##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -434,26 +408,103 @@ public void insertRecords(List<String> deviceIds, List<Long> times,
     }
   }
 
+
   /**
-   * This method NOT insert data into database and the server just return after accept the request,
-   * this method should be used to test other time cost in client
+   * insert data in one row, if you want improve your performance, please use insertInBatch method
+   * or insertBatch method
+   *
+   * @see Session#insertRecords(List, List, List, List, List)
+   * @see Session#insertTablet(Tablet)
    */
-  public void testInsertRecord(String deviceId, long time, List<String> measurements,
-      List<String> values) throws IoTDBConnectionException, StatementExecutionException {
+  public void insertRecord(String deviceId, long time, List<String> measurements,
+      List<TSDataType> types,
+      List<Object> values) throws IoTDBConnectionException, StatementExecutionException {
     TSInsertRecordReq request = new TSInsertRecordReq();
     request.setSessionId(sessionId);
     request.setDeviceId(deviceId);
     request.setTimestamp(time);
     request.setMeasurements(measurements);
-    request.setValues(values);
+    ByteBuffer buffer = ByteBuffer.allocate(calculateLength(types, values));
+    putValues(types, values, buffer);
+    buffer.flip();
+    request.setValues(buffer);
 
     try {
-      RpcUtils.verifySuccess(client.testInsertRecord(request));
+      RpcUtils.verifySuccess(client.insertRecord(request));
     } catch (TException e) {
       throw new IoTDBConnectionException(e);
     }
   }
 
+  /**
+   * put value in buffer
+   * @param types types list
+   * @param values values list
+   * @param buffer buffer to insert
+   * @throws IoTDBConnectionException
+   */
+  private void putValues(List<TSDataType> types, List<Object> values, ByteBuffer buffer)
+      throws IoTDBConnectionException {
+    for (int i = 0; i < values.size(); i++) {
+      ReadWriteIOUtils.write(types.get(i), buffer);
+      switch (types.get(i)) {
+        case BOOLEAN:
+          ReadWriteIOUtils.write((Boolean) values.get(i), buffer);
+          break;
+        case INT32:
+          ReadWriteIOUtils.write((Integer) values.get(i), buffer);
+          break;
+        case INT64:
+          ReadWriteIOUtils.write((Long) values.get(i), buffer);
+          break;
+        case FLOAT:
+          ReadWriteIOUtils.write((Float) values.get(i), buffer);
+          break;
+        case DOUBLE:
+          ReadWriteIOUtils.write((Double) values.get(i), buffer);
+          break;
+        case TEXT:
+          ReadWriteIOUtils.write(new Binary((String) values.get(i)), buffer);

Review comment:
       Fixed~




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-iotdb] jixuan1989 commented on pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

Posted by GitBox <gi...@apache.org>.
jixuan1989 commented on pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229#issuecomment-633351424


   We need to keep compatible with previous versions.. so we'd better to retain the APIs that allow Strings.
   
   By the way, sometimes users may do not know the detailed data type the series is on the server when they write data.
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-iotdb] HTHou commented on a change in pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

Posted by GitBox <gi...@apache.org>.
HTHou commented on a change in pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229#discussion_r429708416



##########
File path: example/rocketmq/src/main/java/org/apache/iotdb/rocketmq/RocketMQConsumer.java
##########
@@ -89,8 +90,37 @@ private void insert(String data) throws IoTDBConnectionException, StatementExecu
     String device = dataArray[0];
     long time = Long.parseLong(dataArray[1]);
     List<String> measurements = Arrays.asList(dataArray[2].split(":"));
-    List<String> values = Arrays.asList(dataArray[3].split(":"));
-    session.insertRecord(device, time, measurements, values);
+    List<TSDataType> types = new ArrayList<>();
+    for(String type : dataArray[3].split(":")){

Review comment:
       ```suggestion
       for (String type : dataArray[3].split(":")) {
   ```

##########
File path: example/rocketmq/src/main/java/org/apache/iotdb/rocketmq/RocketMQConsumer.java
##########
@@ -89,8 +90,37 @@ private void insert(String data) throws IoTDBConnectionException, StatementExecu
     String device = dataArray[0];
     long time = Long.parseLong(dataArray[1]);
     List<String> measurements = Arrays.asList(dataArray[2].split(":"));
-    List<String> values = Arrays.asList(dataArray[3].split(":"));
-    session.insertRecord(device, time, measurements, values);
+    List<TSDataType> types = new ArrayList<>();
+    for(String type : dataArray[3].split(":")){
+      types.add(TSDataType.valueOf(type));
+    }
+
+    List<Object> values = new ArrayList<>();
+    String[] valuesStr = dataArray[4].split(":");
+    for(int i = 0; i < valuesStr.length; i++){

Review comment:
       ```suggestion
       for (int i = 0; i < valuesStr.length; i++) {
   ```

##########
File path: flink-iotdb-connector/src/main/java/org/apache/iotdb/flink/DefaultIoTSerializationSchema.java
##########
@@ -49,12 +52,37 @@ public Event serialize(Map<String,String> tuple) {
             measurements = Arrays.asList(tuple.get(fieldMeasurements).split(separator));
         }
 
-        List<String> values = null;
-        if (tuple.get(fieldValues) != null) {
-            values = Arrays.asList(tuple.get(fieldValues).split(separator));
+        List<TSDataType> types = new ArrayList<>();
+        for(String type : tuple.get(fieldTypes).split(separator)){

Review comment:
       ```suggestion
           for (String type : tuple.get(fieldTypes).split(separator)) {
   ```

##########
File path: flink-iotdb-connector/src/main/java/org/apache/iotdb/flink/DefaultIoTSerializationSchema.java
##########
@@ -49,12 +52,37 @@ public Event serialize(Map<String,String> tuple) {
             measurements = Arrays.asList(tuple.get(fieldMeasurements).split(separator));
         }
 
-        List<String> values = null;
-        if (tuple.get(fieldValues) != null) {
-            values = Arrays.asList(tuple.get(fieldValues).split(separator));
+        List<TSDataType> types = new ArrayList<>();
+        for(String type : tuple.get(fieldTypes).split(separator)){
+            types.add(TSDataType.valueOf(type));
         }
 
-        return new Event(device, timestamp, measurements, values);
+        List<Object> values = new ArrayList<>();
+        String[] valuesStr = tuple.get(fieldValues).split(separator);
+        for(int i = 0; i < valuesStr.length; i++){

Review comment:
       ```suggestion
           for (int i = 0; i < valuesStr.length; i++) {
   ```

##########
File path: flink-iotdb-connector/src/main/java/org/apache/iotdb/flink/DefaultIoTSerializationSchema.java
##########
@@ -49,12 +52,37 @@ public Event serialize(Map<String,String> tuple) {
             measurements = Arrays.asList(tuple.get(fieldMeasurements).split(separator));
         }
 
-        List<String> values = null;
-        if (tuple.get(fieldValues) != null) {
-            values = Arrays.asList(tuple.get(fieldValues).split(separator));
+        List<TSDataType> types = new ArrayList<>();
+        for(String type : tuple.get(fieldTypes).split(separator)){
+            types.add(TSDataType.valueOf(type));
         }
 
-        return new Event(device, timestamp, measurements, values);
+        List<Object> values = new ArrayList<>();
+        String[] valuesStr = tuple.get(fieldValues).split(separator);
+        for(int i = 0; i < valuesStr.length; i++){
+            switch (types.get(i)){

Review comment:
       ```suggestion
               switch (types.get(i)) {
   ```

##########
File path: example/rocketmq/src/main/java/org/apache/iotdb/rocketmq/RocketMQConsumer.java
##########
@@ -89,8 +90,37 @@ private void insert(String data) throws IoTDBConnectionException, StatementExecu
     String device = dataArray[0];
     long time = Long.parseLong(dataArray[1]);
     List<String> measurements = Arrays.asList(dataArray[2].split(":"));
-    List<String> values = Arrays.asList(dataArray[3].split(":"));
-    session.insertRecord(device, time, measurements, values);
+    List<TSDataType> types = new ArrayList<>();
+    for(String type : dataArray[3].split(":")){
+      types.add(TSDataType.valueOf(type));
+    }
+
+    List<Object> values = new ArrayList<>();
+    String[] valuesStr = dataArray[4].split(":");
+    for(int i = 0; i < valuesStr.length; i++){
+      switch (types.get(i)){

Review comment:
       ```suggestion
         switch (types.get(i)) {
   ```




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-iotdb] SilverNarcissus commented on a change in pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

Posted by GitBox <gi...@apache.org>.
SilverNarcissus commented on a change in pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229#discussion_r429772754



##########
File path: service-rpc/rpc-changelist.md
##########
@@ -121,3 +121,34 @@ Last Updated on 2019-10-27 by Lei Rui.
 | Add required i64 statementId in TSExecuteStatementReq        | Yuan Tian |
 | Add required binary time, required list<binary> valueList, required list<binary> bitmapList and remove required binary values, required i32 rowCount in TSQueryDataSet| Yuan Tian |
 | Add optional i32 fetchSize in TSExecuteStatementReq,<br />Add optional TSQueryDataSet in TSExecuteStatementResp| liutaohua |
+| Add optional map<string, string> props, optional map<string, string> tags, optional map<string, string> attributes and optional string aliasPath in TSCreateTimeseriesReq | Yuan Tian | 
+
+
+# 0.10.0 (version-1) -> version-2
+
+Last Updated on November 12th, 2019 by Tian Jiang.
+
+
+## 1. Delete Old
+
+| Latest Changes                     | Related Committers |
+| ---------------------------------- | ------------------ |
+| Remove TS_SessionHandle,TSHandleIdentifier            | Tian Jiang         |
+| Remove TSStatus,TSExecuteInsertRowInBatchResp            | Jialin Qiao|
+
+## 2. Add New
+
+| Latest Changes                                               | Related Committers                 |
+| ------------------------------------------------------------ | ---------------------------------- |
+| Add parameter sessionId in getTimeZone, getProperties, setStorageGroup, createTimeseries... | Tian Jiang|
+| Add struct TSQueryNonAlignDataSet                            | Haonan Hou|
+
+## 3. Update
+
+| Latest Changes                                               | Related Committers     |
+| ------------------------------------------------------------ | ---------------------- |
+| Replace TS_SessionHandles with SessionIds, TSOperationHandle with queryIds  | Tian Jiang  |
+| Add optional TSQueryNonAlignDataSet in TSExecuteStatementResp, TSFetchResultsResp and required bool isAlign in TSFetchResultsReq | Haonan Hou |
+| Rename TSStatusType to TSStatus   | Jialin Qiao   |
+| Remove sessionId in TSExecuteBatchStatementResp   | Jialin Qiao   |

Review comment:
       Sure~

##########
File path: service-rpc/rpc-changelist.md
##########
@@ -121,3 +121,34 @@ Last Updated on 2019-10-27 by Lei Rui.
 | Add required i64 statementId in TSExecuteStatementReq        | Yuan Tian |
 | Add required binary time, required list<binary> valueList, required list<binary> bitmapList and remove required binary values, required i32 rowCount in TSQueryDataSet| Yuan Tian |
 | Add optional i32 fetchSize in TSExecuteStatementReq,<br />Add optional TSQueryDataSet in TSExecuteStatementResp| liutaohua |
+| Add optional map<string, string> props, optional map<string, string> tags, optional map<string, string> attributes and optional string aliasPath in TSCreateTimeseriesReq | Yuan Tian | 
+
+
+# 0.10.0 (version-1) -> version-2
+
+Last Updated on November 12th, 2019 by Tian Jiang.
+
+
+## 1. Delete Old
+
+| Latest Changes                     | Related Committers |
+| ---------------------------------- | ------------------ |
+| Remove TS_SessionHandle,TSHandleIdentifier            | Tian Jiang         |
+| Remove TSStatus,TSExecuteInsertRowInBatchResp            | Jialin Qiao|
+
+## 2. Add New
+
+| Latest Changes                                               | Related Committers                 |
+| ------------------------------------------------------------ | ---------------------------------- |
+| Add parameter sessionId in getTimeZone, getProperties, setStorageGroup, createTimeseries... | Tian Jiang|
+| Add struct TSQueryNonAlignDataSet                            | Haonan Hou|
+
+## 3. Update
+
+| Latest Changes                                               | Related Committers     |
+| ------------------------------------------------------------ | ---------------------- |
+| Replace TS_SessionHandles with SessionIds, TSOperationHandle with queryIds  | Tian Jiang  |
+| Add optional TSQueryNonAlignDataSet in TSExecuteStatementResp, TSFetchResultsResp and required bool isAlign in TSFetchResultsReq | Haonan Hou |
+| Rename TSStatusType to TSStatus   | Jialin Qiao   |
+| Remove sessionId in TSExecuteBatchStatementResp   | Jialin Qiao   |
+| Use TsDataType and binary rather than string in TSInsertInBatchReq and TSInsertReq  | Kaifeng Xue  |

Review comment:
       Sure~




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-iotdb] SilverNarcissus commented on a change in pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

Posted by GitBox <gi...@apache.org>.
SilverNarcissus commented on a change in pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229#discussion_r427795850



##########
File path: example/session/src/main/java/org/apache/iotdb/SessionExample.java
##########
@@ -168,32 +178,47 @@ private static void insertRecords() throws IoTDBConnectionException, BatchExecut
     measurements.add("s3");
     List<String> deviceIds = new ArrayList<>();
     List<List<String>> measurementsList = new ArrayList<>();
-    List<List<String>> valuesList = new ArrayList<>();
+    List<List<Object>> valuesList = new ArrayList<>();
     List<Long> timestamps = new ArrayList<>();
+    List<List<TSDataType>> typesList = new ArrayList<>();
 
     for (long time = 0; time < 500; time++) {
-      List<String> values = new ArrayList<>();
-      values.add("1");
-      values.add("2");
-      values.add("3");
+      List<Object> values = new ArrayList<>();
+      List<TSDataType> types = new ArrayList<>();
+      values.add(1L);
+      values.add(2L);
+      values.add(3L);
+      types.add(TSDataType.INT64);
+      types.add(TSDataType.INT64);
+      types.add(TSDataType.INT64);
 
       deviceIds.add(deviceId);
       measurementsList.add(measurements);
       valuesList.add(values);
+      typesList.add(types);
       timestamps.add(time);
       if (time != 0 && time % 100 == 0) {
-        session.insertRecords(deviceIds, timestamps, measurementsList, valuesList);
+        session.insertRecords(deviceIds, timestamps, measurementsList, typesList, valuesList);
         deviceIds.clear();
         measurementsList.clear();
         valuesList.clear();
         timestamps.clear();
       }
     }
 
-    session.insertRecords(deviceIds, timestamps, measurementsList, valuesList);
+    session.insertRecords(deviceIds, timestamps, measurementsList, typesList, valuesList);
   }
-
   /**
+<<<<<<< HEAD
+   * insert a batch data of one device, each batch contains multiple timestamps with values of
+   * sensors
+   * <p>
+   * a RowBatch example:
+   * <p>
+   * device1 time s1, s2, s3 1,   1,  1,  1 2,   2,  2,  2 3,   3,  3,  3

Review comment:
       Fixed~

##########
File path: example/session/src/main/java/org/apache/iotdb/SessionExample.java
##########
@@ -168,32 +178,47 @@ private static void insertRecords() throws IoTDBConnectionException, BatchExecut
     measurements.add("s3");
     List<String> deviceIds = new ArrayList<>();
     List<List<String>> measurementsList = new ArrayList<>();
-    List<List<String>> valuesList = new ArrayList<>();
+    List<List<Object>> valuesList = new ArrayList<>();
     List<Long> timestamps = new ArrayList<>();
+    List<List<TSDataType>> typesList = new ArrayList<>();
 
     for (long time = 0; time < 500; time++) {
-      List<String> values = new ArrayList<>();
-      values.add("1");
-      values.add("2");
-      values.add("3");
+      List<Object> values = new ArrayList<>();
+      List<TSDataType> types = new ArrayList<>();
+      values.add(1L);
+      values.add(2L);
+      values.add(3L);
+      types.add(TSDataType.INT64);
+      types.add(TSDataType.INT64);
+      types.add(TSDataType.INT64);
 
       deviceIds.add(deviceId);
       measurementsList.add(measurements);
       valuesList.add(values);
+      typesList.add(types);
       timestamps.add(time);
       if (time != 0 && time % 100 == 0) {
-        session.insertRecords(deviceIds, timestamps, measurementsList, valuesList);
+        session.insertRecords(deviceIds, timestamps, measurementsList, typesList, valuesList);
         deviceIds.clear();
         measurementsList.clear();
         valuesList.clear();
         timestamps.clear();
       }
     }
 
-    session.insertRecords(deviceIds, timestamps, measurementsList, valuesList);
+    session.insertRecords(deviceIds, timestamps, measurementsList, typesList, valuesList);
   }
-
   /**
+<<<<<<< HEAD
+   * insert a batch data of one device, each batch contains multiple timestamps with values of
+   * sensors
+   * <p>
+   * a RowBatch example:
+   * <p>
+   * device1 time s1, s2, s3 1,   1,  1,  1 2,   2,  2,  2 3,   3,  3,  3
+   * <p>
+   * Users need to control the count of RowBatch and write a batch when it reaches the maxBatchSize
+=======

Review comment:
       Fixed~

##########
File path: example/session/src/main/java/org/apache/iotdb/SessionExample.java
##########
@@ -205,6 +230,7 @@ private static void insertRecords() throws IoTDBConnectionException, BatchExecut
    * 3,   3,  3,  3
    *
    * Users need to control the count of Tablet and write a batch when it reaches the maxBatchSize
+>>>>>>> 73dd5eb6e44e2194b650eea72aabcfaf929e5bdc

Review comment:
       Fixed~

##########
File path: example/session/src/main/java/org/apache/iotdb/SessionExample.java
##########
@@ -168,32 +178,47 @@ private static void insertRecords() throws IoTDBConnectionException, BatchExecut
     measurements.add("s3");
     List<String> deviceIds = new ArrayList<>();
     List<List<String>> measurementsList = new ArrayList<>();
-    List<List<String>> valuesList = new ArrayList<>();
+    List<List<Object>> valuesList = new ArrayList<>();
     List<Long> timestamps = new ArrayList<>();
+    List<List<TSDataType>> typesList = new ArrayList<>();
 
     for (long time = 0; time < 500; time++) {
-      List<String> values = new ArrayList<>();
-      values.add("1");
-      values.add("2");
-      values.add("3");
+      List<Object> values = new ArrayList<>();
+      List<TSDataType> types = new ArrayList<>();
+      values.add(1L);
+      values.add(2L);
+      values.add(3L);
+      types.add(TSDataType.INT64);
+      types.add(TSDataType.INT64);
+      types.add(TSDataType.INT64);
 
       deviceIds.add(deviceId);
       measurementsList.add(measurements);
       valuesList.add(values);
+      typesList.add(types);
       timestamps.add(time);
       if (time != 0 && time % 100 == 0) {
-        session.insertRecords(deviceIds, timestamps, measurementsList, valuesList);
+        session.insertRecords(deviceIds, timestamps, measurementsList, typesList, valuesList);
         deviceIds.clear();
         measurementsList.clear();
         valuesList.clear();
         timestamps.clear();
       }
     }
 
-    session.insertRecords(deviceIds, timestamps, measurementsList, valuesList);
+    session.insertRecords(deviceIds, timestamps, measurementsList, typesList, valuesList);
   }
-
   /**
+<<<<<<< HEAD

Review comment:
       Fixed~

##########
File path: server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertPlan.java
##########
@@ -174,8 +234,102 @@ public void serializeTo(DataOutputStream stream) throws IOException {
       schema.serializeTo(stream);
     }
 
-    for (String m : values) {
-      putString(stream, m);
+    try {
+      putValues(stream);
+    } catch (QueryProcessException e) {
+      throw new IOException(e);
+    }
+  }
+
+  private void putValues(DataOutputStream outputStream) throws QueryProcessException, IOException {
+    for (int i = 0; i < values.length; i++) {
+      ReadWriteIOUtils.write(types[i], outputStream);
+      switch (types[i]) {
+        case BOOLEAN:
+          ReadWriteIOUtils.write((Boolean) values[i], outputStream);
+          break;
+        case INT32:
+          ReadWriteIOUtils.write((Integer) values[i], outputStream);
+          break;
+        case INT64:
+          ReadWriteIOUtils.write((Long) values[i], outputStream);
+          break;
+        case FLOAT:
+          ReadWriteIOUtils.write((Float) values[i], outputStream);
+          break;
+        case DOUBLE:
+          ReadWriteIOUtils.write((Double) values[i], outputStream);
+          break;
+        case TEXT:
+          ReadWriteIOUtils.write((Binary) values[i], outputStream);
+          break;
+        default:
+          throw new QueryProcessException("Unsupported data type:" + types[i]);
+      }
+    }
+  }
+
+  private void putValues(ByteBuffer buffer) throws QueryProcessException {
+    for (int i = 0; i < values.length; i++) {
+      ReadWriteIOUtils.write(types[i], buffer);
+      switch (types[i]) {
+        case BOOLEAN:
+          ReadWriteIOUtils.write((Boolean) values[i], buffer);
+          break;
+        case INT32:
+          ReadWriteIOUtils.write((Integer) values[i], buffer);
+          break;
+        case INT64:
+          ReadWriteIOUtils.write((Long) values[i], buffer);
+          break;
+        case FLOAT:
+          ReadWriteIOUtils.write((Float) values[i], buffer);
+          break;
+        case DOUBLE:
+          ReadWriteIOUtils.write((Double) values[i], buffer);
+          break;
+        case TEXT:
+          ReadWriteIOUtils.write((Binary) values[i], buffer);
+          break;
+        default:
+          throw new QueryProcessException("Unsupported data type:" + types[i]);
+      }
+    }
+  }
+
+  public TSDataType[] getTypes() {
+    return types;
+  }
+
+  public void setTypes(TSDataType[] types) {
+    this.types = types;
+  }
+
+  public void getValues(ByteBuffer buffer) throws QueryProcessException {

Review comment:
       Sure~

##########
File path: server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
##########
@@ -1111,7 +1118,9 @@ public TSStatus insertRecord(TSInsertRecordReq req) {
       plan.setDeviceId(req.getDeviceId());
       plan.setTime(req.getTimestamp());
       plan.setMeasurements(req.getMeasurements().toArray(new String[0]));
-      plan.setValues(req.getValues().toArray(new String[0]));
+      plan.setTypes(new TSDataType[plan.getMeasurements().length]);
+      plan.setValues(new Object[plan.getMeasurements().length]);
+      plan.getValues(req.values);

Review comment:
       Fixed~

##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -393,16 +359,17 @@ public void insertTablets(Map<String, Tablet> tablets, boolean sorted)
   }
 
   /**
-   * Insert multiple rows, which can reduce the overhead of network. This method is just like
-   * jdbc executeBatch, we pack some insert request in batch and send them to server.
-   * If you want improve your performance, please see insertTablet method
-   *
+   * Insert multiple rows, which can reduce the overhead of network. This method is just like jdbc
+   * executeBatch, we pack some insert request in batch and send them to server. If you want improve
+   * your performance, please see insertTablet method
+   * <p>
    * Each row is independent, which could have different deviceId, time, number of measurements
    *
    * @see Session#insertTablet(Tablet)
    */
   public void insertRecords(List<String> deviceIds, List<Long> times,
-      List<List<String>> measurementsList, List<List<String>> valuesList)
+      List<List<String>> measurementsList, List<List<TSDataType>> typesList,
+      List<List<Object>> valuesList)

Review comment:
       If user uses wrong type, we will fall at server end. I think we need fall at client to follow the "fall quickly" principle.

##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -215,66 +218,29 @@ private boolean reconnect() {
   }
 
   /**
-   * insert data in one row, if you want to improve your performance, please use insertRecords method
-   * or insertTablet method
+   * insert data in one row, if you want to improve your performance, please use insertRecords
+   * method or insertTablet method
    *
-   * @see Session#insertRecords(List, List, List, List)
+   * @see Session#insertRecords(List, List, List, List, List)
    * @see Session#insertTablet(Tablet)
    */
   public void insertRecord(String deviceId, long time, List<String> measurements,
+      List<TSDataType> types,
       Object... values) throws IoTDBConnectionException, StatementExecutionException {
-    List<String> stringValues = new ArrayList<>();
-    for (Object o : values) {
-      stringValues.add(o.toString());
-    }
+    List<Object> valuesList = new ArrayList<>(Arrays.asList(values));
 
-    insertRecord(deviceId, time, measurements, stringValues);
+    insertRecord(deviceId, time, measurements, types, valuesList);
   }
 
-  /**
-   * insert data in one row, if you want to improve your performance, please use insertRecords method
-   * or insertTablet method
-   *
-   * @see Session#insertRecords(List, List, List, List)
-   * @see Session#insertTablet(Tablet)
-   */
-  public void insertRecord(String deviceId, long time, List<String> measurements,
-      List<String> values) throws IoTDBConnectionException, StatementExecutionException {
-    TSInsertRecordReq request = new TSInsertRecordReq();
-    request.setSessionId(sessionId);
-    request.setDeviceId(deviceId);
-    request.setTimestamp(time);
-    request.setMeasurements(measurements);
-    request.setValues(values);
-
-    try {
-      RpcUtils.verifySuccess(client.insertRecord(request));
-    } catch (TException e) {
-      if (reconnect()) {
-        try {
-          RpcUtils.verifySuccess(client.insertRecord(request));
-        } catch (TException e1) {
-          throw new IoTDBConnectionException(e1);
-        }
-      } else {
-        throw new IoTDBConnectionException("Fail to reconnect to server,"
-            + " please check server status", e);
-      }
-    }
-  }
 
 
   /**
    * insert the data of a device. For each timestamp, the number of measurements is the same.
-   *
-   *  a Tablet example:
-   *
-   *        device1
-   *     time s1, s2, s3
-   *     1,   1,  1,  1
-   *     2,   2,  2,  2
-   *     3,   3,  3,  3
-   *
+   * <p>
+   * a Tablet example:
+   * <p>
+   * device1 time s1, s2, s3 1,   1,  1,  1 2,   2,  2,  2 3,   3,  3,  3
+   * <p>

Review comment:
       Sure~

##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -215,66 +218,29 @@ private boolean reconnect() {
   }
 
   /**
-   * insert data in one row, if you want to improve your performance, please use insertRecords method
-   * or insertTablet method
+   * insert data in one row, if you want to improve your performance, please use insertRecords
+   * method or insertTablet method
    *
-   * @see Session#insertRecords(List, List, List, List)
+   * @see Session#insertRecords(List, List, List, List, List)
    * @see Session#insertTablet(Tablet)
    */
   public void insertRecord(String deviceId, long time, List<String> measurements,
+      List<TSDataType> types,
       Object... values) throws IoTDBConnectionException, StatementExecutionException {

Review comment:
       This method is add for some client using dynamic parameter. 

##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -215,66 +218,29 @@ private boolean reconnect() {
   }
 
   /**
-   * insert data in one row, if you want to improve your performance, please use insertRecords method
-   * or insertTablet method
+   * insert data in one row, if you want to improve your performance, please use insertRecords
+   * method or insertTablet method
    *
-   * @see Session#insertRecords(List, List, List, List)
+   * @see Session#insertRecords(List, List, List, List, List)
    * @see Session#insertTablet(Tablet)
    */
   public void insertRecord(String deviceId, long time, List<String> measurements,
+      List<TSDataType> types,
       Object... values) throws IoTDBConnectionException, StatementExecutionException {
-    List<String> stringValues = new ArrayList<>();
-    for (Object o : values) {
-      stringValues.add(o.toString());
-    }
+    List<Object> valuesList = new ArrayList<>(Arrays.asList(values));
 
-    insertRecord(deviceId, time, measurements, stringValues);
+    insertRecord(deviceId, time, measurements, types, valuesList);
   }
 
-  /**
-   * insert data in one row, if you want to improve your performance, please use insertRecords method
-   * or insertTablet method
-   *
-   * @see Session#insertRecords(List, List, List, List)
-   * @see Session#insertTablet(Tablet)
-   */
-  public void insertRecord(String deviceId, long time, List<String> measurements,

Review comment:
       Thanks~ Could you give a function signature here?

##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -215,66 +218,29 @@ private boolean reconnect() {
   }
 
   /**
-   * insert data in one row, if you want to improve your performance, please use insertRecords method
-   * or insertTablet method
+   * insert data in one row, if you want to improve your performance, please use insertRecords
+   * method or insertTablet method
    *
-   * @see Session#insertRecords(List, List, List, List)
+   * @see Session#insertRecords(List, List, List, List, List)
    * @see Session#insertTablet(Tablet)
    */
   public void insertRecord(String deviceId, long time, List<String> measurements,
+      List<TSDataType> types,

Review comment:
       If user uses wrong type, we will fall at server end. I think we need fall at client to follow the "fall quickly" principle.

##########
File path: service-rpc/rpc-changelist.md
##########
@@ -121,3 +121,35 @@ Last Updated on 2019-10-27 by Lei Rui.
 | Add required i64 statementId in TSExecuteStatementReq        | Yuan Tian |
 | Add required binary time, required list<binary> valueList, required list<binary> bitmapList and remove required binary values, required i32 rowCount in TSQueryDataSet| Yuan Tian |
 | Add optional i32 fetchSize in TSExecuteStatementReq,<br />Add optional TSQueryDataSet in TSExecuteStatementResp| liutaohua |
+<<<<<<< HEAD

Review comment:
       Sure~

##########
File path: example/rocketmq/src/main/java/org/apache/iotdb/rocketmq/RocketMQConsumer.java
##########
@@ -89,8 +90,37 @@ private void insert(String data) throws IoTDBConnectionException, StatementExecu
     String device = dataArray[0];
     long time = Long.parseLong(dataArray[1]);
     List<String> measurements = Arrays.asList(dataArray[2].split(":"));
-    List<String> values = Arrays.asList(dataArray[3].split(":"));
-    session.insertRecord(device, time, measurements, values);
+    List<TSDataType> types = new ArrayList<>();

Review comment:
       Fixed~




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-iotdb] SilverNarcissus commented on a change in pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

Posted by GitBox <gi...@apache.org>.
SilverNarcissus commented on a change in pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229#discussion_r429773914



##########
File path: flink-iotdb-connector/src/main/java/org/apache/iotdb/flink/DefaultIoTSerializationSchema.java
##########
@@ -49,12 +52,37 @@ public Event serialize(Map<String,String> tuple) {
             measurements = Arrays.asList(tuple.get(fieldMeasurements).split(separator));
         }
 
-        List<String> values = null;
-        if (tuple.get(fieldValues) != null) {
-            values = Arrays.asList(tuple.get(fieldValues).split(separator));
+        List<TSDataType> types = new ArrayList<>();
+        for(String type : tuple.get(fieldTypes).split(separator)){

Review comment:
       fixed~

##########
File path: flink-iotdb-connector/src/main/java/org/apache/iotdb/flink/DefaultIoTSerializationSchema.java
##########
@@ -49,12 +52,37 @@ public Event serialize(Map<String,String> tuple) {
             measurements = Arrays.asList(tuple.get(fieldMeasurements).split(separator));
         }
 
-        List<String> values = null;
-        if (tuple.get(fieldValues) != null) {
-            values = Arrays.asList(tuple.get(fieldValues).split(separator));
+        List<TSDataType> types = new ArrayList<>();
+        for(String type : tuple.get(fieldTypes).split(separator)){
+            types.add(TSDataType.valueOf(type));
         }
 
-        return new Event(device, timestamp, measurements, values);
+        List<Object> values = new ArrayList<>();
+        String[] valuesStr = tuple.get(fieldValues).split(separator);
+        for(int i = 0; i < valuesStr.length; i++){

Review comment:
       fixed~

##########
File path: flink-iotdb-connector/src/main/java/org/apache/iotdb/flink/DefaultIoTSerializationSchema.java
##########
@@ -49,12 +52,37 @@ public Event serialize(Map<String,String> tuple) {
             measurements = Arrays.asList(tuple.get(fieldMeasurements).split(separator));
         }
 
-        List<String> values = null;
-        if (tuple.get(fieldValues) != null) {
-            values = Arrays.asList(tuple.get(fieldValues).split(separator));
+        List<TSDataType> types = new ArrayList<>();
+        for(String type : tuple.get(fieldTypes).split(separator)){
+            types.add(TSDataType.valueOf(type));
         }
 
-        return new Event(device, timestamp, measurements, values);
+        List<Object> values = new ArrayList<>();
+        String[] valuesStr = tuple.get(fieldValues).split(separator);
+        for(int i = 0; i < valuesStr.length; i++){
+            switch (types.get(i)){

Review comment:
       fixed~




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-iotdb] HTHou commented on a change in pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

Posted by GitBox <gi...@apache.org>.
HTHou commented on a change in pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229#discussion_r429704084



##########
File path: service-rpc/rpc-changelist.md
##########
@@ -121,3 +121,34 @@ Last Updated on 2019-10-27 by Lei Rui.
 | Add required i64 statementId in TSExecuteStatementReq        | Yuan Tian |
 | Add required binary time, required list<binary> valueList, required list<binary> bitmapList and remove required binary values, required i32 rowCount in TSQueryDataSet| Yuan Tian |
 | Add optional i32 fetchSize in TSExecuteStatementReq,<br />Add optional TSQueryDataSet in TSExecuteStatementResp| liutaohua |
+| Add optional map<string, string> props, optional map<string, string> tags, optional map<string, string> attributes and optional string aliasPath in TSCreateTimeseriesReq | Yuan Tian | 
+
+
+# 0.10.0 (version-1) -> version-2
+
+Last Updated on November 12th, 2019 by Tian Jiang.
+
+
+## 1. Delete Old
+
+| Latest Changes                     | Related Committers |
+| ---------------------------------- | ------------------ |
+| Remove TS_SessionHandle,TSHandleIdentifier            | Tian Jiang         |
+| Remove TSStatus,TSExecuteInsertRowInBatchResp            | Jialin Qiao|
+
+## 2. Add New
+
+| Latest Changes                                               | Related Committers                 |
+| ------------------------------------------------------------ | ---------------------------------- |
+| Add parameter sessionId in getTimeZone, getProperties, setStorageGroup, createTimeseries... | Tian Jiang|
+| Add struct TSQueryNonAlignDataSet                            | Haonan Hou|
+
+## 3. Update
+
+| Latest Changes                                               | Related Committers     |
+| ------------------------------------------------------------ | ---------------------- |
+| Replace TS_SessionHandles with SessionIds, TSOperationHandle with queryIds  | Tian Jiang  |
+| Add optional TSQueryNonAlignDataSet in TSExecuteStatementResp, TSFetchResultsResp and required bool isAlign in TSFetchResultsReq | Haonan Hou |
+| Rename TSStatusType to TSStatus   | Jialin Qiao   |
+| Remove sessionId in TSExecuteBatchStatementResp   | Jialin Qiao   |
+| Use TsDataType and binary rather than string in TSInsertInBatchReq and TSInsertReq  | Kaifeng Xue  |

Review comment:
       Move this line to line 53.

##########
File path: service-rpc/rpc-changelist.md
##########
@@ -121,3 +121,34 @@ Last Updated on 2019-10-27 by Lei Rui.
 | Add required i64 statementId in TSExecuteStatementReq        | Yuan Tian |
 | Add required binary time, required list<binary> valueList, required list<binary> bitmapList and remove required binary values, required i32 rowCount in TSQueryDataSet| Yuan Tian |
 | Add optional i32 fetchSize in TSExecuteStatementReq,<br />Add optional TSQueryDataSet in TSExecuteStatementResp| liutaohua |
+| Add optional map<string, string> props, optional map<string, string> tags, optional map<string, string> attributes and optional string aliasPath in TSCreateTimeseriesReq | Yuan Tian | 
+
+
+# 0.10.0 (version-1) -> version-2
+
+Last Updated on November 12th, 2019 by Tian Jiang.
+
+
+## 1. Delete Old
+
+| Latest Changes                     | Related Committers |
+| ---------------------------------- | ------------------ |
+| Remove TS_SessionHandle,TSHandleIdentifier            | Tian Jiang         |
+| Remove TSStatus,TSExecuteInsertRowInBatchResp            | Jialin Qiao|
+
+## 2. Add New
+
+| Latest Changes                                               | Related Committers                 |
+| ------------------------------------------------------------ | ---------------------------------- |
+| Add parameter sessionId in getTimeZone, getProperties, setStorageGroup, createTimeseries... | Tian Jiang|
+| Add struct TSQueryNonAlignDataSet                            | Haonan Hou|
+
+## 3. Update
+
+| Latest Changes                                               | Related Committers     |
+| ------------------------------------------------------------ | ---------------------- |
+| Replace TS_SessionHandles with SessionIds, TSOperationHandle with queryIds  | Tian Jiang  |
+| Add optional TSQueryNonAlignDataSet in TSExecuteStatementResp, TSFetchResultsResp and required bool isAlign in TSFetchResultsReq | Haonan Hou |
+| Rename TSStatusType to TSStatus   | Jialin Qiao   |
+| Remove sessionId in TSExecuteBatchStatementResp   | Jialin Qiao   |

Review comment:
       I think this is a part of the out-of-date content. It's better to remove it. 




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-iotdb] sonarcloud[bot] commented on pull request #1229: [IOTDB-615] Use binary rather than string in insert plan

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #1229:
URL: https://github.com/apache/incubator-iotdb/pull/1229#issuecomment-632217380


   SonarCloud Quality Gate failed.
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=SECURITY_HOTSPOT) [5 Security Hotspots](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=SECURITY_HOTSPOT) to review)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=CODE_SMELL) [9 Code Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=1229&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=1229) No Coverage information  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10.png' alt='9.9%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=1229&metric=new_duplicated_lines_density&view=list) [9.9% Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=1229&metric=new_duplicated_lines_density&view=list)
   
   


----------------------------------------------------------------
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:
users@infra.apache.org