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/06/20 10:04:01 UTC

[GitHub] [incubator-iotdb] mychaow opened a new pull request #1395: add partialInsert for insertTablets

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


   


----------------------------------------------------------------
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 #1395: add partialInsert for insertTablets

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



##########
File path: server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
##########
@@ -1122,17 +1122,28 @@ public void insertTablet(InsertTabletPlan insertTabletPlan) throws QueryProcessE
 
         // check data type
         if (measurementNode.getSchema().getType() != insertTabletPlan.getDataTypes()[i]) {
-          throw new QueryProcessException(String.format(
+          if (!enablePartialInsert) {
+            logger.error("not enable");

Review comment:
       ```suggestion
               logger.warn("insertion is interrupted because of not enable partial insertion");
   ```

##########
File path: server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
##########
@@ -1122,17 +1122,28 @@ public void insertTablet(InsertTabletPlan insertTabletPlan) throws QueryProcessE
 
         // check data type
         if (measurementNode.getSchema().getType() != insertTabletPlan.getDataTypes()[i]) {
-          throw new QueryProcessException(String.format(
+          if (!enablePartialInsert) {
+            logger.error("not enable");
+            throw new QueryProcessException(String.format(
               "Datatype mismatch, Insert measurement %s type %s, metadata tree type %s",
               measurement, insertTabletPlan.getDataTypes()[i],
               measurementNode.getSchema().getType()));
+          } else {
+            logger.error("failed {}", i);
+            insertTabletPlan.markMeasurementInsertionFailed(i);
+            continue;
+          }
         }
         schemas[i] = measurementNode.getSchema();
         // reset measurement to common name instead of alias
         measurementList[i] = measurementNode.getName();
       }
       insertTabletPlan.setSchemas(schemas);
       StorageEngine.getInstance().insertTablet(insertTabletPlan);
+      if (insertTabletPlan.getFailedMeasurements() != null) {
+        throw new StorageEngineException(
+          "failed to insert points " + insertTabletPlan.getFailedMeasurements());

Review comment:
       ```suggestion
             "failed to insert measurements " + insertTabletPlan.getFailedMeasurements());
   ```

##########
File path: server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
##########
@@ -1122,17 +1122,28 @@ public void insertTablet(InsertTabletPlan insertTabletPlan) throws QueryProcessE
 
         // check data type
         if (measurementNode.getSchema().getType() != insertTabletPlan.getDataTypes()[i]) {
-          throw new QueryProcessException(String.format(
+          if (!enablePartialInsert) {
+            logger.error("not enable");
+            throw new QueryProcessException(String.format(
               "Datatype mismatch, Insert measurement %s type %s, metadata tree type %s",
               measurement, insertTabletPlan.getDataTypes()[i],
               measurementNode.getSchema().getType()));
+          } else {
+            logger.error("failed {}", i);

Review comment:
       ```suggestion
               logger.warn("the {}-th measurement {} failed", i, measurement);
   ```




----------------------------------------------------------------
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 #1395: add partialInsert for insertTablets

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


   


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