jt2594838 commented on a change in pull request #1771:
URL: https://github.com/apache/incubator-iotdb/pull/1771#discussion_r496444420
##########
File path:
server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
##########
@@ -1040,6 +1029,31 @@ private boolean createTimeSeries(CreateTimeSeriesPlan
createTimeSeriesPlan)
return true;
}
+ private boolean createMultiTimeSeries(CreateMultiTimeSeriesPlan
createMultiTimeSeriesPlan) {
+ Map<Integer, Boolean> results = new
HashMap<>(createMultiTimeSeriesPlan.getPaths().size());
+ for (int i = 0; i < createMultiTimeSeriesPlan.getPaths().size(); i++) {
+ CreateTimeSeriesPlan plan = new
CreateTimeSeriesPlan(createMultiTimeSeriesPlan.getPaths().get(i),
+ createMultiTimeSeriesPlan.getDataTypes().get(i),
createMultiTimeSeriesPlan.getEncodings().get(i),
+ createMultiTimeSeriesPlan.getCompressors().get(i),
+ createMultiTimeSeriesPlan.getProps() == null ? null :
createMultiTimeSeriesPlan.getProps().get(i),
+ createMultiTimeSeriesPlan.getTags() == null ? null :
createMultiTimeSeriesPlan.getTags().get(i),
+ createMultiTimeSeriesPlan.getAttributes() == null ? null :
createMultiTimeSeriesPlan.getAttributes().get(i),
+ createMultiTimeSeriesPlan.getAlias() == null ? null :
createMultiTimeSeriesPlan.getAlias().get(i));
+
+ boolean success = false;
+ try {
+ success = createTimeSeries(plan);
+ } catch (QueryProcessException e) {
+ // do nothing
+ logger.debug("meet error while processing create timeseries. ", e);
+ } finally {
+ results.put(createMultiTimeSeriesPlan.getIndexes().get(i), success);
Review comment:
I recommend that you straightly make` results` a `Map<Integer,
Exception>` and record the potential `QueryProcessException` into it since
`createTimeSeries` always returns true if there is no exception. And when
changed this way, you would be able to tell the user what are the reasons
behind the failures, instead of a simple failure.
##########
File path: server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
##########
@@ -1533,14 +1528,35 @@ public TSStatus
createMultiTimeseries(TSCreateMultiTimeseriesReq req) {
req.getPaths().size(), req.getPaths().get(0));
}
List<TSStatus> statusList = new ArrayList<>(req.paths.size());
+ CreateTimeSeriesPlan plan = new CreateTimeSeriesPlan();
Review comment:
What is this plan for?
----------------------------------------------------------------
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:
[email protected]