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/03/11 06:39:04 UTC

[GitHub] [incubator-iotdb] qiaojialin commented on a change in pull request #899: Use a batched style to get series type

qiaojialin commented on a change in pull request #899: Use a batched style to get series type
URL: https://github.com/apache/incubator-iotdb/pull/899#discussion_r390757069
 
 

 ##########
 File path: server/src/main/java/org/apache/iotdb/db/utils/SchemaUtils.java
 ##########
 @@ -96,46 +92,79 @@ public static void registerTimeseries(MeasurementSchema schema) {
     }
 
   }
+  public static List<TSDataType> getSeriesTypesByPath(Collection<Path> paths) throws MetadataException {
+    List<TSDataType> dataTypes = new ArrayList<>();
+    for (Path path : paths) {
+      dataTypes.add(MManager.getInstance().getSeriesType(path.getFullPath()));
+    }
+    return dataTypes;
+  }
 
-  public static TSDataType getSeriesType(String path)
-      throws MetadataException {
-    switch (path.toLowerCase()) {
-      // authorization queries
-      case COLUMN_ROLE:
-      case COLUMN_USER:
-      case COLUMN_PRIVILEGE:
-      case COLUMN_STORAGE_GROUP:
-        return TSDataType.TEXT;
-      case SQLConstant.RESERVED_TIME:
-      case COLUMN_TTL:
-        return TSDataType.INT64;
-      default:
-        // do nothing
+  public static List<TSDataType> getSeriesTypesByString(Collection<String> paths,
+      String aggregation) throws MetadataException {
+    TSDataType dataType = getAggregationType(aggregation);
+    if (dataType != null) {
+      return Collections.nCopies(paths.size(), dataType);
+    }
+    List<TSDataType> dataTypes = new ArrayList<>();
+    for (String path : paths) {
+      dataTypes.add(MManager.getInstance().getSeriesType(path));
+    }
+    return dataTypes;
+  }
+
+  public static List<TSDataType> getSeriesTypesByPath(Collection<Path> paths,
 
 Review comment:
   This method is not used

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


With regards,
Apache Git Services