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 2021/04/06 11:59:11 UTC

[GitHub] [iotdb] SilverNarcissus commented on a change in pull request #2888: [IOTDB-1253] [To Vector] Support null value in aligned time series

SilverNarcissus commented on a change in pull request #2888:
URL: https://github.com/apache/iotdb/pull/2888#discussion_r607774840



##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -1453,6 +1453,10 @@ private int calculateLength(List<TSDataType> types, List<Object> values)
   private void putValues(List<TSDataType> types, List<Object> values, ByteBuffer buffer)
       throws IoTDBConnectionException {
     for (int i = 0; i < values.size(); i++) {
+      if (values.get(i) == null) {
+        ReadWriteIOUtils.write((byte) -2, buffer);

Review comment:
       Maybe this "-2" can be a constant with a understandable name.

##########
File path: server/src/main/java/org/apache/iotdb/db/utils/TypeInferenceUtils.java
##########
@@ -81,6 +81,8 @@ public static TSDataType getPredictedDataType(Object value, boolean inferType) {
           return floatingStringInferType;
         }
         // "NaN" is returned if the NaN Literal is given in Parser
+      } else if ("null".equals(strValue)) {

Review comment:
       What if user pass a "NULL" as value? Should we think "NULL" also a null?




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