You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ro...@apache.org on 2021/06/03 08:15:27 UTC

[iotdb] branch rel/0.11 updated: [IOTDB-1412] Unclear exception message thrown when executing empty InsertTabletPlan (#3296) (#3321)

This is an automated email from the ASF dual-hosted git repository.

rong pushed a commit to branch rel/0.11
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/rel/0.11 by this push:
     new ea8dd7b  [IOTDB-1412] Unclear exception message thrown when executing empty InsertTabletPlan (#3296) (#3321)
ea8dd7b is described below

commit ea8dd7b0481b2ddbbac49de96fa4fc7ebc6ee425
Author: Steve Yurong Su (宇荣) <ro...@apache.org>
AuthorDate: Thu Jun 3 03:04:25 2021 -0500

    [IOTDB-1412] Unclear exception message thrown when executing empty InsertTabletPlan (#3296) (#3321)
    
    (cherry picked from commit e19ad0575d597bcd0a6dd74ea54a1bc7fcfe5e3d)
---
 .../src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java b/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
index 6e02613..cc6a173 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
@@ -917,6 +917,9 @@ public class PlanExecutor implements IPlanExecutor {
   @Override
   public void insert(InsertRowsOfOneDevicePlan insertRowsOfOneDevicePlan)
       throws QueryProcessException {
+    if (insertRowsOfOneDevicePlan.getRowPlans().length == 0) {
+      return;
+    }
     try {
       for (InsertRowPlan plan : insertRowsOfOneDevicePlan.getRowPlans()) {
         plan.setMeasurementMNodes(new MeasurementMNode[plan.getMeasurements().length]);
@@ -973,6 +976,9 @@ public class PlanExecutor implements IPlanExecutor {
 
   @Override
   public void insertTablet(InsertTabletPlan insertTabletPlan) throws QueryProcessException {
+    if (insertTabletPlan.getRowCount() == 0) {
+      return;
+    }
     try {
       insertTabletPlan
           .setMeasurementMNodes(new MeasurementMNode[insertTabletPlan.getMeasurements().length]);