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

haonan pushed a commit to branch pr2956
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 0993537710f131b543a9d7b6015bec8f9bc8de79
Author: HTHou <[email protected]>
AuthorDate: Thu Apr 22 19:07:47 2021 +0800

    fix bug
---
 .../java/org/apache/iotdb/db/qp/strategy/PhysicalGenerator.java   | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git 
a/server/src/main/java/org/apache/iotdb/db/qp/strategy/PhysicalGenerator.java 
b/server/src/main/java/org/apache/iotdb/db/qp/strategy/PhysicalGenerator.java
index b3ef8fe..2c2bb96 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/qp/strategy/PhysicalGenerator.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/qp/strategy/PhysicalGenerator.java
@@ -242,13 +242,13 @@ public class PhysicalGenerator {
             measurementsNum++;
           }
         }
-        if (insert.getValueList().length % insert.getMeasurementList().length 
!= 0) {
+        if (insert.getValueList().length % measurementsNum != 0) {
           throw new SQLParserException(
               String.format(
                   "the measurementList's size %d is not consistent with the 
valueList's size %d",
                   measurementsNum, insert.getValueList().length));
         }
-        if (insert.getMeasurementList().length == 
insert.getValueList().length) {
+        if (measurementsNum == insert.getValueList().length) {
           return new InsertRowPlan(
               paths.get(0),
               insert.getTime()[0],
@@ -263,9 +263,7 @@ public class PhysicalGenerator {
                   insert.getTime()[i],
                   insert.getMeasurementList(),
                   Arrays.copyOfRange(
-                      insert.getValueList(),
-                      i * insert.getMeasurementList().length,
-                      (i + 1) * insert.getMeasurementList().length)),
+                      insert.getValueList(), i * measurementsNum, (i + 1) * 
measurementsNum)),
               i);
         }
         return insertRowsPlan;

Reply via email to