JackieTien97 commented on code in PR #12477:
URL: https://github.com/apache/iotdb/pull/12477#discussion_r1606149885


##########
iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/IoTDBJDBCDataSet.java:
##########
@@ -573,7 +588,18 @@ public String getString(int index, TSDataType tsDataType, 
byte[][] values) {
       case DOUBLE:
         return String.valueOf(BytesUtils.bytesToDouble(values[index]));
       case TEXT:
+      case STRING:
         return new String(values[index], StandardCharsets.UTF_8);
+      case BLOB:
+        return BytesUtils.parseBlobByteArrayToString(values[index]);
+      case TIMESTAMP:
+        return RpcUtils.formatDatetime(
+            RpcUtils.DEFAULT_TIME_FORMAT,
+            "ms",
+            BytesUtils.bytesToLong(values[index]),
+            ZoneId.systemDefault());

Review Comment:
   should add a `zoneId` field?



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/utils/InsertRowDataUtils.java:
##########
@@ -95,6 +97,8 @@ public static List<Object> reGenValues(List<TSDataType> 
types, List<Object> valu
           }
           break;
         case TEXT:
+        case BLOB:

Review Comment:
   for Blob, I think they pass String like "X'xaf'", so we need to parse that 
String.



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/literal/Literal.java:
##########
@@ -36,7 +36,8 @@ public enum LiteralType {
     DOUBLE,
     LONG,
     STRING,
-    NULL
+    NULL,
+    BINARY

Review Comment:
   why don't you add a switch-case in `deserialize` method



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/InsertStatement.java:
##########
@@ -43,7 +43,7 @@ public class InsertStatement extends Statement {
   private long[] times;
   private String[] measurementList;
 
-  private List<String[]> valuesList;
+  private List<Object[]> valuesList;

Review Comment:
   why here need to be changed to Object[], it seems that all the caller is set 
String[]



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/v1/handler/StatementConstructionHandler.java:
##########
@@ -140,6 +142,8 @@ public static InsertTabletStatement 
constructInsertTabletStatement(
           columns[columnIndex] = doubleValues;
           break;
         case TEXT:
+        case BLOB:

Review Comment:
   we should parse blob



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/v2/handler/StatementConstructionHandler.java:
##########
@@ -147,6 +149,8 @@ public static InsertTabletStatement 
constructInsertTabletStatement(
           columns[columnIndex] = doubleValues;
           break;
         case TEXT:
+        case BLOB:

Review Comment:
   we should parse blob



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java:
##########
@@ -2234,8 +2234,10 @@ public TSEncoding getDefaultEncodingByType(TSDataType 
dataType) {
       case BOOLEAN:
         return conf.getDefaultBooleanEncoding();
       case INT32:
+      case DATE:
         return conf.getDefaultInt32Encoding();
       case INT64:
+      case STRING:

Review Comment:
   String should be default branch? and what for TIMESTAMP? I think it should 
be same as default time encoder.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to