You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hu...@apache.org on 2022/07/02 03:43:54 UTC

[iotdb] branch lmh/fillCheckDebug created (now a2ebf08a87)

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

hui pushed a change to branch lmh/fillCheckDebug
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at a2ebf08a87 add more test

This branch includes the following new commits:

     new 1015abafb7 fix datatype check
     new b2a37046c3 Linear fill is not supported in align by device query
     new 757297509a Merge remote-tracking branch 'origin/master' into lmh/fillCheckDebug
     new 80f941f5e5 add semantic check
     new 803d94beab add IT
     new efe4c4bc04 Merge remote-tracking branch 'origin/master' into lmh/fillCheckDebug
     new 22ec8cbcf3 modify exception message
     new a2ebf08a87 add more test

The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[iotdb] 03/08: Merge remote-tracking branch 'origin/master' into lmh/fillCheckDebug

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hui pushed a commit to branch lmh/fillCheckDebug
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 757297509a3151dfab3f15a1c07e071224bb3a17
Merge: b2a37046c3 0b7cdfba2c
Author: Minghui Liu <li...@foxmail.com>
AuthorDate: Fri Jul 1 17:43:34 2022 +0800

    Merge remote-tracking branch 'origin/master' into lmh/fillCheckDebug

 .../iotdb/consensus/config/MultiLeaderConfig.java  |   46 +-
 .../multileader/MultiLeaderConsensus.java          |    2 +-
 .../multileader/service/MultiLeaderRPCService.java |   17 +-
 .../service/MultiLeaderRPCServiceProcessor.java    |   59 +-
 grafana-plugin/backend-compile.sh                  |    1 -
 integration-test/checkstyle.xml                    |    2 +-
 integration-test/import-control.xml                |    2 +
 .../java/org/apache/iotdb/it/env/MppConfig.java    |    7 +
 .../apache/iotdb/itbase/constant/TestConstant.java |    2 +
 .../org/apache/iotdb/itbase/env/BaseConfig.java    |   16 +
 .../db/it/aligned/IoTDBAlignedSeriesQueryIT.java   | 2594 ++++++++++++++++++++
 .../db/it/aligned/IoTDBGroupByLevelQueryIT.java    |  168 +-
 ...GroupByQueryWithValueFilterWithDeletion2IT.java |   43 +-
 ...BGroupByQueryWithValueFilterWithDeletionIT.java |  268 +-
 .../iotdb/db/it/env/StandaloneEnvConfig.java       |   12 +
 .../apache/iotdb/db/it/groupby/IOTDBGroupByIT.java |  531 ++++
 .../db/it/groupby/IoTDBGroupByNaturalMonthIT.java  |  246 ++
 .../iotdb/db/it}/groupby/IoTDBGroupByUnseqIT.java  |  109 +-
 .../org/apache/iotdb/db/it/query/IoTDBAliasIT.java |  384 +++
 .../iotdb/db/it/query/IoTDBPaginationIT.java       |  152 ++
 .../query}/IoTDBQueryWithComplexValueFilterIT.java |   59 +-
 .../apache/iotdb/db/it/query/IoTDBResultSetIT.java |  131 +
 .../org/apache/iotdb/db/it/utils/TestUtils.java    |  251 ++
 .../apache/iotdb/db/integration/IoTDBAliasIT.java  |  396 ---
 .../org/apache/iotdb/db/integration/IoTDBAsIT.java |  564 -----
 .../iotdb/db/integration/IoTDBLimitSlimitIT.java   |  204 --
 .../db/integration/IoTDBPathNumOverLimitIT.java    |   74 -
 .../db/integration/IoTDBResultMetadataIT.java      |   89 -
 .../iotdb/db/integration/IoTDBResultSetIT.java     |  134 -
 .../IoTDBGroupByQueryWithValueFilter2IT.java       |   65 -
 .../IoTDBGroupByQueryWithValueFilterIT.java        | 1094 ---------
 ...GroupBySlidingWindowQueryWithValueFilterIT.java |  951 -------
 ...upBySlidingWindowQueryWithoutValueFilterIT.java |  947 -------
 .../db/integration/groupby/IOTDBGroupByIT.java     |  996 --------
 .../groupby/IOTDBGroupByInnerIntervalIT.java       |  342 ---
 .../integration/groupby/IoTDBGroupByMonthIT.java   |  366 ---
 ...IT.java => IoTDBGroupByNaturalMonthFillIT.java} |    7 +-
 .../service/AbstractThriftServiceThread.java       |   34 +-
 .../iotdb/commons/service/ThriftServiceThread.java |    4 +
 server/file-changelists/conf-changelist.md         |    3 +
 .../resources/conf/iotdb-datanode.properties       |    6 +
 .../java/org/apache/iotdb/db/conf/IoTDBConfig.java |   22 +
 .../org/apache/iotdb/db/conf/IoTDBDescriptor.java  |   22 +
 .../db/consensus/DataRegionConsensusImpl.java      |    4 +
 .../exception/query/PathNumOverLimitException.java |    3 +-
 .../{query => sql}/PathNumOverLimitException.java  |    7 +-
 .../apache/iotdb/db/mpp/plan/analyze/Analyzer.java |   10 +-
 .../plan/analyze/ColumnPaginationController.java   |   12 +-
 .../org/apache/iotdb/rpc/IoTDBJDBCDataSet.java     |   15 +-
 .../java/org/apache/iotdb/rpc/IoTDBRpcDataSet.java |    6 +-
 50 files changed, 4770 insertions(+), 6709 deletions(-)



[iotdb] 07/08: modify exception message

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hui pushed a commit to branch lmh/fillCheckDebug
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 22ec8cbcf318c450d26ee4b2a0d6f7aa4ac2e6fd
Author: Minghui Liu <li...@foxmail.com>
AuthorDate: Sat Jul 2 11:23:23 2022 +0800

    modify exception message
---
 .../java/org/apache/iotdb/db/mpp/plan/analyze/Analyzer.java | 13 ++++++++++---
 .../iotdb/db/mpp/plan/statement/literal/BooleanLiteral.java |  5 +++++
 .../iotdb/db/mpp/plan/statement/literal/DoubleLiteral.java  |  5 +++++
 .../apache/iotdb/db/mpp/plan/statement/literal/Literal.java |  2 ++
 .../iotdb/db/mpp/plan/statement/literal/LongLiteral.java    |  5 +++++
 .../iotdb/db/mpp/plan/statement/literal/NullLiteral.java    |  5 +++++
 .../iotdb/db/mpp/plan/statement/literal/StringLiteral.java  |  5 +++++
 7 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/Analyzer.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/Analyzer.java
index c29081c2a5..2dd7c55ff9 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/Analyzer.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/Analyzer.java
@@ -416,13 +416,19 @@ public class Analyzer {
               TSDataType checkedDataType = typeProvider.getType(fillColumn.getExpressionString());
               if (!fillComponent.getFillValue().isDataTypeConsistency(checkedDataType)) {
                 throw new SemanticException(
-                    "FILL: the data type of the fill value should be the same as the output column");
+                    String.format(
+                        "Data type mismatch: column '%s' (dataType '%s') doesn't support fill with '%s' (dataType '%s').",
+                        fillColumn.getExpressionString(),
+                        checkedDataType,
+                        fillComponent.getFillValue().getBinary(),
+                        fillComponent.getFillValue().getDataTypeString()));
               }
             }
           } else if (fillComponent.getFillPolicy() == FillPolicy.LINEAR) {
             // TODO support linear fill in align by device query
             if (queryStatement.isAlignByDevice()) {
-              throw new SemanticException("Linear fill is not supported in align by device query.");
+              throw new SemanticException(
+                  "Linear fill is not supported in align by device query yet.");
             }
 
             for (Expression fillColumn : fillColumnList) {
@@ -430,7 +436,8 @@ public class Analyzer {
               if (!checkedDataType.isNumeric()) {
                 throw new SemanticException(
                     String.format(
-                        "FILL: dataType %s doesn't support linear fill.", checkedDataType));
+                        "Data type mismatch: column '%s' (dataType '%s') doesn't support linear fill.",
+                        fillColumn.getExpressionString(), checkedDataType));
               }
             }
           }
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/BooleanLiteral.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/BooleanLiteral.java
index 203badb1de..8cbe5db20f 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/BooleanLiteral.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/BooleanLiteral.java
@@ -57,6 +57,11 @@ public class BooleanLiteral extends Literal {
     return dataType == TSDataType.BOOLEAN || dataType == TSDataType.TEXT;
   }
 
+  @Override
+  public String getDataTypeString() {
+    return TSDataType.BOOLEAN.toString();
+  }
+
   @Override
   public boolean equals(Object o) {
     if (this == o) {
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/DoubleLiteral.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/DoubleLiteral.java
index 3647f95b15..868d87276a 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/DoubleLiteral.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/DoubleLiteral.java
@@ -58,6 +58,11 @@ public class DoubleLiteral extends Literal {
         || dataType == TSDataType.TEXT;
   }
 
+  @Override
+  public String getDataTypeString() {
+    return TSDataType.DOUBLE.toString();
+  }
+
   @Override
   public boolean equals(Object o) {
     if (this == o) {
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/Literal.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/Literal.java
index ec9c348f4c..710d9b9694 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/Literal.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/Literal.java
@@ -62,6 +62,8 @@ public abstract class Literal extends StatementNode {
 
   public abstract boolean isDataTypeConsistency(TSDataType dataType);
 
+  public abstract String getDataTypeString();
+
   public boolean getBoolean() {
     throw new UnsupportedOperationException(getClass().getName());
   }
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/LongLiteral.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/LongLiteral.java
index 16767f2210..6014f1c387 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/LongLiteral.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/LongLiteral.java
@@ -64,6 +64,11 @@ public class LongLiteral extends Literal {
         || dataType == TSDataType.TEXT;
   }
 
+  @Override
+  public String getDataTypeString() {
+    return TSDataType.INT64.toString();
+  }
+
   @Override
   public int getInt() {
     return Math.toIntExact(value);
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/NullLiteral.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/NullLiteral.java
index 67d0cfe818..51221a494a 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/NullLiteral.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/NullLiteral.java
@@ -44,6 +44,11 @@ public class NullLiteral extends Literal {
     return false;
   }
 
+  @Override
+  public String getDataTypeString() {
+    return "NULL";
+  }
+
   @Override
   public Binary getBinary() {
     return new Binary("null");
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/StringLiteral.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/StringLiteral.java
index 6bfb05e561..118680ce47 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/StringLiteral.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/StringLiteral.java
@@ -56,6 +56,11 @@ public class StringLiteral extends Literal {
     return dataType == TSDataType.TEXT;
   }
 
+  @Override
+  public String getDataTypeString() {
+    return TSDataType.TEXT.toString();
+  }
+
   @Override
   public Binary getBinary() {
     return new Binary(value);


[iotdb] 04/08: add semantic check

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hui pushed a commit to branch lmh/fillCheckDebug
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 80f941f5e5f10c208c7bc0f7986fb5af3e4532b2
Author: Minghui Liu <li...@foxmail.com>
AuthorDate: Sat Jul 2 10:49:09 2022 +0800

    add semantic check
---
 .../java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java   | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java
index 4418d11349..8b87ae0f0b 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java
@@ -973,8 +973,14 @@ public class ASTVisitor extends IoTDBSqlParserBaseVisitor<Statement> {
   public void parseFillClause(IoTDBSqlParser.FillClauseContext ctx) {
     FillComponent fillComponent = new FillComponent();
     if (ctx.linearClause() != null) {
+      if (ctx.linearClause().DURATION_LITERAL().size() > 0) {
+        throw new SemanticException("The specified fill time range is not supported.");
+      }
       fillComponent.setFillPolicy(FillPolicy.LINEAR);
     } else if (ctx.previousClause() != null) {
+      if (ctx.previousClause().DURATION_LITERAL() != null) {
+        throw new SemanticException("The specified fill time range is not supported.");
+      }
       fillComponent.setFillPolicy(FillPolicy.PREVIOUS);
     } else if (ctx.specificValueClause() != null) {
       fillComponent.setFillPolicy(FillPolicy.VALUE);
@@ -984,6 +990,10 @@ public class ASTVisitor extends IoTDBSqlParserBaseVisitor<Statement> {
       } else {
         throw new SemanticException("fill value cannot be null");
       }
+    } else if (ctx.previousUntilLastClause() != null) {
+      throw new SemanticException("PREVIOUSUNTILLAST fill is not supported yet.");
+    } else if (ctx.oldTypeClause() != null) {
+      throw new SemanticException("The specified fill datatype is not supported.");
     }
     queryStatement.setFillComponent(fillComponent);
   }


[iotdb] 08/08: add more test

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hui pushed a commit to branch lmh/fillCheckDebug
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit a2ebf08a87ed5c1daf48a40e55b02eec5d43234a
Author: Minghui Liu <li...@foxmail.com>
AuthorDate: Sat Jul 2 11:43:34 2022 +0800

    add more test
---
 .../iotdb/db/it/query/IoTDBNullValueFillIT.java    | 141 ++++++++++++++++++++-
 1 file changed, 136 insertions(+), 5 deletions(-)

diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBNullValueFillIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBNullValueFillIT.java
index 5198c28668..59264a60ad 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBNullValueFillIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBNullValueFillIT.java
@@ -25,10 +25,12 @@ import org.apache.iotdb.itbase.category.ClusterIT;
 
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
 
+import static org.apache.iotdb.db.it.utils.TestUtils.assertTestFail;
 import static org.apache.iotdb.db.it.utils.TestUtils.prepareData;
 import static org.apache.iotdb.db.it.utils.TestUtils.resultSetEqualTest;
 import static org.apache.iotdb.db.it.utils.TestUtils.resultSetEqualWithDescOrderTest;
@@ -59,7 +61,7 @@ public class IoTDBNullValueFillIT {
    * 3, null, 3, null, 3.0, null, t3<br>
    * 4, 4, null, 4.0, null, false, null<br>
    * 5, 5, 5, 5.0, 5.0, false, t5<br>
-   * 6, 6, null, 6.0, 6.0, null, t6<br>
+   * 6, 6, null, 6.0, null, false, null<br>
    * 7, null, null, null, null, null, null<br>
    * 8, 8, 8, 8.0, 8.0, true, t8<br>
    * 9, null, 9, null, 9.0, null, t9
@@ -120,7 +122,7 @@ public class IoTDBNullValueFillIT {
           "1,null,1,null,1.0,null,t1,",
           "2,2,2,2.0,2.0,true,t2,",
           "3,3,2,3.0,2.0,false,t2,",
-          "4,3,4,3.0,4.0,false,t4",
+          "4,3,4,3.0,4.0,false,t4,",
           "5,5,5,5.0,5.0,false,t5,",
           "6,5,6,5.0,6.0,false,t6,",
           "8,8,8,8.0,8.0,true,t8,",
@@ -160,6 +162,63 @@ public class IoTDBNullValueFillIT {
   }
 
   @Test
+  public void previousFillAlignByDeviceTest() {
+    String[] expectedHeader = new String[] {"Time", "Device", "s1", "s2", "s3", "s4", "s5", "s6"};
+    String[] retArray =
+        new String[] {
+          "1,root.sg1.d1,null,1,null,1.0,null,t1,",
+          "2,root.sg1.d1,2,2,2.0,2.0,true,t2,",
+          "3,root.sg1.d1,3,2,3.0,2.0,false,t2,",
+          "4,root.sg1.d1,3,4,3.0,4.0,false,t4,",
+          "5,root.sg1.d1,5,5,5.0,5.0,false,t5,",
+          "6,root.sg1.d1,5,6,5.0,6.0,false,t6,",
+          "8,root.sg1.d1,8,8,8.0,8.0,true,t8,",
+          "9,root.sg1.d1,9,8,9.0,8.0,true,t8,",
+          "1,root.sg1.d2,1,8,1.0,8.0,true,t8,",
+          "2,root.sg1.d2,2,2,2.0,2.0,true,t2,",
+          "3,root.sg1.d2,2,3,2.0,3.0,true,t3,",
+          "4,root.sg1.d2,4,3,4.0,3.0,false,t3,",
+          "5,root.sg1.d2,5,5,5.0,5.0,false,t5,",
+          "6,root.sg1.d2,6,5,6.0,5.0,false,t5,",
+          "8,root.sg1.d2,8,8,8.0,8.0,true,t8,",
+          "9,root.sg1.d2,8,9,8.0,9.0,true,t9,"
+        };
+    resultSetEqualTest(
+        "select s1, s2, s3, s4, s5, s6 from root.sg1.* fill(previous) align by device",
+        expectedHeader,
+        retArray);
+  }
+
+  @Test
+  public void previousDescFillAlignByDeviceTest() {
+    String[] expectedHeader = new String[] {"Time", "Device", "s1", "s2", "s3", "s4", "s5", "s6"};
+    String[] retArray =
+        new String[] {
+          "9,root.sg1.d1,9,null,9.0,null,true,null,",
+          "8,root.sg1.d1,8,8,8.0,8.0,true,t8,",
+          "6,root.sg1.d1,8,6,8.0,6.0,true,t6,",
+          "5,root.sg1.d1,5,5,5.0,5.0,false,t5,",
+          "4,root.sg1.d1,5,4,5.0,4.0,false,t4,",
+          "3,root.sg1.d1,3,4,3.0,4.0,false,t4,",
+          "2,root.sg1.d1,2,2,2.0,2.0,true,t2,",
+          "1,root.sg1.d1,2,1,2.0,1.0,true,t1,",
+          "9,root.sg1.d2,2,9,2.0,9.0,true,t9,",
+          "8,root.sg1.d2,8,8,8.0,8.0,true,t8,",
+          "6,root.sg1.d2,6,8,6.0,8.0,false,t8,",
+          "5,root.sg1.d2,5,5,5.0,5.0,false,t5,",
+          "4,root.sg1.d2,4,5,4.0,5.0,false,t5,",
+          "3,root.sg1.d2,4,3,4.0,3.0,false,t3,",
+          "2,root.sg1.d2,2,2,2.0,2.0,true,t2,",
+          "1,root.sg1.d2,1,2,1.0,2.0,true,t2,"
+        };
+    resultSetEqualTest(
+        "select s1, s2, s3, s4, s5, s6 from root.sg1.* fill(previous) order by time desc align by device",
+        expectedHeader,
+        retArray);
+  }
+
+  @Test
+  @Ignore // TODO fix IOTDB-3724
   public void linearFillTest() {
     String[] expectedHeader =
         new String[] {
@@ -180,6 +239,23 @@ public class IoTDBNullValueFillIT {
         "select s1, s2, s3, s4 from root.sg1.d1 fill(linear)", expectedHeader, retArray);
   }
 
+  @Test
+  public void linearFillAlignByDeviceTest() {
+    assertTestFail(
+        "select s1, s2, s3, s4 from root.sg1.d1 fill(linear) align by device",
+        "Linear fill is not supported in align by device query yet.");
+  }
+
+  @Test
+  public void linearFillDataTypeMisMatchTest() {
+    assertTestFail(
+        "select s1, s5 from root.sg1.d1 fill(linear)",
+        "Data type mismatch: column 'root.sg1.d1.s5' (dataType 'BOOLEAN') doesn't support linear fill.");
+    assertTestFail(
+        "select s1, s6 from root.sg1.d1 fill(linear)",
+        "Data type mismatch: column 'root.sg1.d1.s6' (dataType 'TEXT') doesn't support linear fill.");
+  }
+
   @Test
   public void intFillTest() {
     String[] expectedHeader =
@@ -195,17 +271,24 @@ public class IoTDBNullValueFillIT {
         new String[] {
           "1,1000,1,1000.0,1.0,t1,",
           "2,2,2,2.0,2.0,t2,",
-          "3,3,1000,3.0,1000.0,1000",
+          "3,3,1000,3.0,1000.0,1000,",
           "4,1000,4,1000.0,4.0,t4,",
           "5,5,5,5.0,5.0,t5,",
           "6,1000,6,1000.0,6.0,t6,",
-          "8,8,8,8.0,8.0,1000,",
-          "9,9,1000,9.0,1000.0,t8,"
+          "8,8,8,8.0,8.0,t8,",
+          "9,9,1000,9.0,1000.0,1000,"
         };
     resultSetEqualWithDescOrderTest(
         "select s1, s2, s3, s4, s6 from root.sg1.d1 fill(1000)", expectedHeader, retArray);
   }
 
+  @Test
+  public void intFillDataTypeMisMatchTest() {
+    assertTestFail(
+        "select s1, s5 from root.sg1.d1 fill(1000)",
+        "Data type mismatch: column 'root.sg1.d1.s5' (dataType 'BOOLEAN') doesn't support fill with '1000' (dataType 'INT64').");
+  }
+
   @Test
   public void floatFillTest() {
     String[] expectedHeader =
@@ -225,6 +308,19 @@ public class IoTDBNullValueFillIT {
         "select s3, s4, s6 from root.sg1.d1 fill(3.14)", expectedHeader, retArray);
   }
 
+  @Test
+  public void floatFillDataTypeMisMatchTest() {
+    assertTestFail(
+        "select s1, s3 from root.sg1.d1 fill(3.14)",
+        "Data type mismatch: column 'root.sg1.d1.s1' (dataType 'INT32') doesn't support fill with '3.14' (dataType 'DOUBLE').");
+    assertTestFail(
+        "select s2, s3 from root.sg1.d1 fill(3.14)",
+        "Data type mismatch: column 'root.sg1.d1.s2' (dataType 'INT64') doesn't support fill with '3.14' (dataType 'DOUBLE').");
+    assertTestFail(
+        "select s5, s3 from root.sg1.d1 fill(3.14)",
+        "Data type mismatch: column 'root.sg1.d1.s5' (dataType 'BOOLEAN') doesn't support fill with '3.14' (dataType 'DOUBLE').");
+  }
+
   @Test
   public void booleanFillTest() {
     String[] expectedHeader = new String[] {"Time", "root.sg1.d1.s5", "root.sg1.d1.s6"};
@@ -243,6 +339,22 @@ public class IoTDBNullValueFillIT {
         "select s5, s6 from root.sg1.d1 fill(true)", expectedHeader, retArray);
   }
 
+  @Test
+  public void booleanFillDataTypeMisMatchTest() {
+    assertTestFail(
+        "select s5, s1 from root.sg1.d1 fill(true)",
+        "Data type mismatch: column 'root.sg1.d1.s1' (dataType 'INT32') doesn't support fill with 'true' (dataType 'BOOLEAN').");
+    assertTestFail(
+        "select s5, s2 from root.sg1.d1 fill(true)",
+        "Data type mismatch: column 'root.sg1.d1.s2' (dataType 'INT64') doesn't support fill with 'true' (dataType 'BOOLEAN').");
+    assertTestFail(
+        "select s5, s3 from root.sg1.d1 fill(true)",
+        "Data type mismatch: column 'root.sg1.d1.s3' (dataType 'FLOAT') doesn't support fill with 'true' (dataType 'BOOLEAN').");
+    assertTestFail(
+        "select s5, s4 from root.sg1.d1 fill(true)",
+        "Data type mismatch: column 'root.sg1.d1.s4' (dataType 'DOUBLE') doesn't support fill with 'true' (dataType 'BOOLEAN').");
+  }
+
   @Test
   public void textFillTest() {
     String[] expectedHeader = new String[] {"Time", "root.sg1.d1.s6", "root.sg1.d2.s6"};
@@ -260,4 +372,23 @@ public class IoTDBNullValueFillIT {
     resultSetEqualWithDescOrderTest(
         "select s6 from root.sg1.d1, root.sg1.d2 fill('t0')", expectedHeader, retArray);
   }
+
+  @Test
+  public void textFillDataTypeMisMatchTest() {
+    assertTestFail(
+        "select s6, s1 from root.sg1.d1 fill('t0')",
+        "Data type mismatch: column 'root.sg1.d1.s1' (dataType 'INT32') doesn't support fill with 't0' (dataType 'TEXT').");
+    assertTestFail(
+        "select s6, s2 from root.sg1.d1 fill('t0')",
+        "Data type mismatch: column 'root.sg1.d1.s2' (dataType 'INT64') doesn't support fill with 't0' (dataType 'TEXT').");
+    assertTestFail(
+        "select s6, s3 from root.sg1.d1 fill('t0')",
+        "Data type mismatch: column 'root.sg1.d1.s3' (dataType 'FLOAT') doesn't support fill with 't0' (dataType 'TEXT').");
+    assertTestFail(
+        "select s6, s4 from root.sg1.d1 fill('t0')",
+        "Data type mismatch: column 'root.sg1.d1.s4' (dataType 'DOUBLE') doesn't support fill with 't0' (dataType 'TEXT').");
+    assertTestFail(
+        "select s6, s5 from root.sg1.d1 fill('t0')",
+        "Data type mismatch: column 'root.sg1.d1.s5' (dataType 'BOOLEAN') doesn't support fill with 't0' (dataType 'TEXT').");
+  }
 }


[iotdb] 01/08: fix datatype check

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hui pushed a commit to branch lmh/fillCheckDebug
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 1015abafb75493b0dba00c7ea2462e2d7153b8f5
Author: Minghui Liu <li...@foxmail.com>
AuthorDate: Fri Jul 1 17:35:17 2022 +0800

    fix datatype check
---
 .../src/main/java/org/apache/iotdb/db/mpp/plan/analyze/Analyzer.java  | 4 ++++
 .../apache/iotdb/db/mpp/plan/statement/literal/BooleanLiteral.java    | 2 +-
 .../org/apache/iotdb/db/mpp/plan/statement/literal/DoubleLiteral.java | 4 +++-
 .../org/apache/iotdb/db/mpp/plan/statement/literal/LongLiteral.java   | 3 ++-
 4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/Analyzer.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/Analyzer.java
index 9885f8b29e..190a245ee1 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/Analyzer.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/Analyzer.java
@@ -414,6 +414,10 @@ public class Analyzer {
               }
             }
           } else if (fillComponent.getFillPolicy() == FillPolicy.LINEAR) {
+            if (queryStatement.isAlignByDevice()) {
+              throw new SemanticException("");
+            }
+
             for (Expression fillColumn : fillColumnList) {
               TSDataType checkedDataType = typeProvider.getType(fillColumn.getExpressionString());
               if (!checkedDataType.isNumeric()) {
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/BooleanLiteral.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/BooleanLiteral.java
index 132024e9a0..203badb1de 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/BooleanLiteral.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/BooleanLiteral.java
@@ -54,7 +54,7 @@ public class BooleanLiteral extends Literal {
 
   @Override
   public boolean isDataTypeConsistency(TSDataType dataType) {
-    return dataType == TSDataType.BOOLEAN;
+    return dataType == TSDataType.BOOLEAN || dataType == TSDataType.TEXT;
   }
 
   @Override
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/DoubleLiteral.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/DoubleLiteral.java
index 508ba4f514..3647f95b15 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/DoubleLiteral.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/DoubleLiteral.java
@@ -53,7 +53,9 @@ public class DoubleLiteral extends Literal {
 
   @Override
   public boolean isDataTypeConsistency(TSDataType dataType) {
-    return dataType == TSDataType.FLOAT || dataType == TSDataType.DOUBLE;
+    return dataType == TSDataType.FLOAT
+        || dataType == TSDataType.DOUBLE
+        || dataType == TSDataType.TEXT;
   }
 
   @Override
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/LongLiteral.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/LongLiteral.java
index dd9e3c507f..16767f2210 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/LongLiteral.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/literal/LongLiteral.java
@@ -60,7 +60,8 @@ public class LongLiteral extends Literal {
     return dataType == TSDataType.INT32
         || dataType == TSDataType.INT64
         || dataType == TSDataType.FLOAT
-        || dataType == TSDataType.DOUBLE;
+        || dataType == TSDataType.DOUBLE
+        || dataType == TSDataType.TEXT;
   }
 
   @Override


[iotdb] 02/08: Linear fill is not supported in align by device query

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hui pushed a commit to branch lmh/fillCheckDebug
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit b2a37046c3a7b5a8cca9e6cae8b15de4b26e4acc
Author: Minghui Liu <li...@foxmail.com>
AuthorDate: Fri Jul 1 17:42:17 2022 +0800

    Linear fill is not supported in align by device query
---
 .../src/main/java/org/apache/iotdb/db/mpp/plan/analyze/Analyzer.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/Analyzer.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/Analyzer.java
index 190a245ee1..6b3f7d0d40 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/Analyzer.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/Analyzer.java
@@ -414,8 +414,9 @@ public class Analyzer {
               }
             }
           } else if (fillComponent.getFillPolicy() == FillPolicy.LINEAR) {
+            // TODO support linear fill in align by device query
             if (queryStatement.isAlignByDevice()) {
-              throw new SemanticException("");
+              throw new SemanticException("Linear fill is not supported in align by device query.");
             }
 
             for (Expression fillColumn : fillColumnList) {


[iotdb] 05/08: add IT

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hui pushed a commit to branch lmh/fillCheckDebug
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 803d94beabbc112a09e6d3285bff25c216415e1a
Author: Minghui Liu <li...@foxmail.com>
AuthorDate: Sat Jul 2 10:49:16 2022 +0800

    add IT
---
 .../iotdb/db/it/query/IoTDBNullValueFillIT.java    | 263 +++++++++++++++++++++
 1 file changed, 263 insertions(+)

diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBNullValueFillIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBNullValueFillIT.java
new file mode 100644
index 0000000000..5198c28668
--- /dev/null
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBNullValueFillIT.java
@@ -0,0 +1,263 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.it.query;
+
+import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.IoTDBTestRunner;
+import org.apache.iotdb.itbase.category.ClusterIT;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+
+import static org.apache.iotdb.db.it.utils.TestUtils.prepareData;
+import static org.apache.iotdb.db.it.utils.TestUtils.resultSetEqualTest;
+import static org.apache.iotdb.db.it.utils.TestUtils.resultSetEqualWithDescOrderTest;
+
+@RunWith(IoTDBTestRunner.class)
+@Category({ClusterIT.class}) // TODO add LocalStandaloneIT
+public class IoTDBNullValueFillIT {
+
+  /**
+   * [root.sg1.d1 (aligned)]
+   *
+   * <p>Time, s1[INT32], s2[INT64], s3[FLOAT], s4[DOUBLE], s5[BOOLEAN], s6[TEXT]<br>
+   * 1, null, 1, null, 1.0, null, t1<br>
+   * 2, 2, 2, 2.0, 2.0, true, t2<br>
+   * 3, 3, null, 3.0, null, false, null<br>
+   * 4, null, 4, null, 4.0, null, t4<br>
+   * 5, 5, 5, 5.0, 5.0, false, t5<br>
+   * 6, null, 6, null, null, false, null<br>
+   * 7, null, null, null, null, null, null<br>
+   * 8, 8, 8, 8.0, 8.0, true, t8<br>
+   * 9, 9, null, 9.0, null, true, null
+   *
+   * <p>[root.sg1.d2 (non-aligned)]
+   *
+   * <p>Time, s1[INT32], s2[INT64], s3[FLOAT], s4[DOUBLE], s5[BOOLEAN], s6[TEXT]<br>
+   * 1, 1, null, 1.0, null, true, null<br>
+   * 2, 2, 2, 2.0, 2.0, true, t2<br>
+   * 3, null, 3, null, 3.0, null, t3<br>
+   * 4, 4, null, 4.0, null, false, null<br>
+   * 5, 5, 5, 5.0, 5.0, false, t5<br>
+   * 6, 6, null, 6.0, 6.0, null, t6<br>
+   * 7, null, null, null, null, null, null<br>
+   * 8, 8, 8, 8.0, 8.0, true, t8<br>
+   * 9, null, 9, null, 9.0, null, t9
+   */
+  private static final String[] sqls =
+      new String[] {
+        "SET STORAGE GROUP TO root.sg1",
+        "create aligned timeseries root.sg1.d1(s1 INT32, s2 INT64, s3 FLOAT, s4 DOUBLE, s5 BOOLEAN, s6 TEXT)",
+        "insert into root.sg1.d1(time, s2, s4, s6) aligned values(1, 1, 1.0, 't1')",
+        "insert into root.sg1.d1(time, s1, s2, s3, s4, s5, s6) aligned values(2, 2, 2, 2.0, 2.0, true, 't2')",
+        "insert into root.sg1.d1(time, s1, s3, s5) aligned values(3, 3, 3.0, false)",
+        "insert into root.sg1.d1(time, s2, s4, s6) aligned values(4, 4, 4.0, 't4')",
+        "insert into root.sg1.d1(time, s1, s2, s3, s4, s5, s6) aligned values(5, 5, 5, 5.0, 5.0, false, 't5')",
+        "insert into root.sg1.d1(time, s2, s4, s6) aligned values(6, 6, 6.0, 't6')",
+        "insert into root.sg1.d1(time, s1, s2, s3, s4, s5, s6) aligned values(8, 8, 8, 8.0, 8.0, true, 't8')",
+        "insert into root.sg1.d1(time, s1, s3, s5) aligned values(9, 9, 9.0, true)",
+        "create timeseries root.sg1.d2.s1 INT32",
+        "create timeseries root.sg1.d2.s2 INT64",
+        "create timeseries root.sg1.d2.s3 FLOAT",
+        "create timeseries root.sg1.d2.s4 DOUBLE",
+        "create timeseries root.sg1.d2.s5 BOOLEAN",
+        "create timeseries root.sg1.d2.s6 TEXT",
+        "insert into root.sg1.d2(time, s1, s3, s5) values(1, 1, 1.0, true)",
+        "insert into root.sg1.d2(time, s1, s2, s3, s4, s5, s6) values(2, 2, 2, 2.0, 2.0, true, 't2')",
+        "insert into root.sg1.d2(time, s2, s4, s6) values(3, 3, 3.0, 't3')",
+        "insert into root.sg1.d2(time, s1, s3, s5) values(4, 4, 4.0, false)",
+        "insert into root.sg1.d2(time, s1, s2, s3, s4, s5, s6) values(5, 5, 5, 5.0, 5.0, false, 't5')",
+        "insert into root.sg1.d2(time, s1, s3, s5) values(6, 6, 6.0, false)",
+        "insert into root.sg1.d2(time, s1, s2, s3, s4, s5, s6) values(8, 8, 8, 8.0, 8.0, true, 't8')",
+        "insert into root.sg1.d2(time, s2, s4, s6) values(9, 9, 9.0, 't9')"
+      };
+
+  @BeforeClass
+  public static void setUp() throws Exception {
+    EnvFactory.getEnv().initBeforeClass();
+    prepareData(sqls);
+  }
+
+  @AfterClass
+  public static void tearDown() throws Exception {
+    EnvFactory.getEnv().cleanAfterClass();
+  }
+
+  @Test
+  public void previousFillTest() {
+    String[] expectedHeader =
+        new String[] {
+          "Time",
+          "root.sg1.d1.s1",
+          "root.sg1.d1.s2",
+          "root.sg1.d1.s3",
+          "root.sg1.d1.s4",
+          "root.sg1.d1.s5",
+          "root.sg1.d1.s6"
+        };
+    String[] retArray =
+        new String[] {
+          "1,null,1,null,1.0,null,t1,",
+          "2,2,2,2.0,2.0,true,t2,",
+          "3,3,2,3.0,2.0,false,t2,",
+          "4,3,4,3.0,4.0,false,t4",
+          "5,5,5,5.0,5.0,false,t5,",
+          "6,5,6,5.0,6.0,false,t6,",
+          "8,8,8,8.0,8.0,true,t8,",
+          "9,9,8,9.0,8.0,true,t8,"
+        };
+    resultSetEqualTest(
+        "select s1, s2, s3, s4, s5, s6 from root.sg1.d1 fill(previous)", expectedHeader, retArray);
+  }
+
+  @Test
+  public void previousDescFillTest() {
+    String[] expectedHeader =
+        new String[] {
+          "Time",
+          "root.sg1.d1.s1",
+          "root.sg1.d1.s2",
+          "root.sg1.d1.s3",
+          "root.sg1.d1.s4",
+          "root.sg1.d1.s5",
+          "root.sg1.d1.s6"
+        };
+    String[] retArray =
+        new String[] {
+          "9,9,null,9.0,null,true,null,",
+          "8,8,8,8.0,8.0,true,t8,",
+          "6,8,6,8.0,6.0,true,t6,",
+          "5,5,5,5.0,5.0,false,t5,",
+          "4,5,4,5.0,4.0,false,t4,",
+          "3,3,4,3.0,4.0,false,t4,",
+          "2,2,2,2.0,2.0,true,t2,",
+          "1,2,1,2.0,1.0,true,t1,"
+        };
+    resultSetEqualTest(
+        "select s1, s2, s3, s4, s5, s6 from root.sg1.d1 fill(previous) order by time desc",
+        expectedHeader,
+        retArray);
+  }
+
+  @Test
+  public void linearFillTest() {
+    String[] expectedHeader =
+        new String[] {
+          "Time", "root.sg1.d1.s1", "root.sg1.d1.s2", "root.sg1.d1.s3", "root.sg1.d1.s4"
+        };
+    String[] retArray =
+        new String[] {
+          "1,null,1,null,1.0,",
+          "2,2,2,2.0,2.0,",
+          "3,3,3,3.0,3.0,",
+          "4,4,4,4.0,4.0,",
+          "5,5,5,5.0,5.0,",
+          "6,6,6,6.5,6.0,",
+          "8,8,8,8.0,8.0,",
+          "9,9,null,9.0,null,"
+        };
+    resultSetEqualWithDescOrderTest(
+        "select s1, s2, s3, s4 from root.sg1.d1 fill(linear)", expectedHeader, retArray);
+  }
+
+  @Test
+  public void intFillTest() {
+    String[] expectedHeader =
+        new String[] {
+          "Time",
+          "root.sg1.d1.s1",
+          "root.sg1.d1.s2",
+          "root.sg1.d1.s3",
+          "root.sg1.d1.s4",
+          "root.sg1.d1.s6"
+        };
+    String[] retArray =
+        new String[] {
+          "1,1000,1,1000.0,1.0,t1,",
+          "2,2,2,2.0,2.0,t2,",
+          "3,3,1000,3.0,1000.0,1000",
+          "4,1000,4,1000.0,4.0,t4,",
+          "5,5,5,5.0,5.0,t5,",
+          "6,1000,6,1000.0,6.0,t6,",
+          "8,8,8,8.0,8.0,1000,",
+          "9,9,1000,9.0,1000.0,t8,"
+        };
+    resultSetEqualWithDescOrderTest(
+        "select s1, s2, s3, s4, s6 from root.sg1.d1 fill(1000)", expectedHeader, retArray);
+  }
+
+  @Test
+  public void floatFillTest() {
+    String[] expectedHeader =
+        new String[] {"Time", "root.sg1.d1.s3", "root.sg1.d1.s4", "root.sg1.d1.s6"};
+    String[] retArray =
+        new String[] {
+          "1,3.14,1.0,t1,",
+          "2,2.0,2.0,t2,",
+          "3,3.0,3.14,3.14,",
+          "4,3.14,4.0,t4,",
+          "5,5.0,5.0,t5,",
+          "6,3.14,6.0,t6,",
+          "8,8.0,8.0,t8,",
+          "9,9.0,3.14,3.14,"
+        };
+    resultSetEqualWithDescOrderTest(
+        "select s3, s4, s6 from root.sg1.d1 fill(3.14)", expectedHeader, retArray);
+  }
+
+  @Test
+  public void booleanFillTest() {
+    String[] expectedHeader = new String[] {"Time", "root.sg1.d1.s5", "root.sg1.d1.s6"};
+    String[] retArray =
+        new String[] {
+          "1,true,t1,",
+          "2,true,t2,",
+          "3,false,true,",
+          "4,true,t4,",
+          "5,false,t5,",
+          "6,true,t6,",
+          "8,true,t8,",
+          "9,true,true,"
+        };
+    resultSetEqualWithDescOrderTest(
+        "select s5, s6 from root.sg1.d1 fill(true)", expectedHeader, retArray);
+  }
+
+  @Test
+  public void textFillTest() {
+    String[] expectedHeader = new String[] {"Time", "root.sg1.d1.s6", "root.sg1.d2.s6"};
+    String[] retArray =
+        new String[] {
+          "1,t1,t0,",
+          "2,t2,t2,",
+          "3,t0,t3,",
+          "4,t4,t0,",
+          "5,t5,t5,",
+          "6,t6,t0,",
+          "8,t8,t8,",
+          "9,t0,t9,"
+        };
+    resultSetEqualWithDescOrderTest(
+        "select s6 from root.sg1.d1, root.sg1.d2 fill('t0')", expectedHeader, retArray);
+  }
+}


[iotdb] 06/08: Merge remote-tracking branch 'origin/master' into lmh/fillCheckDebug

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hui pushed a commit to branch lmh/fillCheckDebug
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit efe4c4bc04cec19f4eeb23c3bd5f29522ac465e2
Merge: 803d94beab 708a08c9b7
Author: Minghui Liu <li...@foxmail.com>
AuthorDate: Sat Jul 2 10:49:23 2022 +0800

    Merge remote-tracking branch 'origin/master' into lmh/fillCheckDebug

 .../org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4   |   1 +
 .../antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4  |   2 +
 .../assembly/resources/sbin/stop-confignode.bat    |   6 +-
 .../src/assembly/resources/sbin/stop-confignode.sh |   6 +-
 .../confignode/client/AsyncDataNodeClientPool.java |  44 ++-
 .../confignode/client/SyncDataNodeClientPool.java  |  15 -
 .../confignode/client/handlers/SetTTLHandler.java  |  58 ++++
 .../consensus/request/ConfigPhysicalPlan.java      |   8 +-
 .../consensus/request/ConfigPhysicalPlanType.java  |   1 +
 .../request/write/ActivateDataNodePlan.java        |  71 +++++
 ...egionsPlan.java => CreateRegionGroupsPlan.java} |   6 +-
 .../confignode/manager/ClusterSchemaManager.java   |  46 ++-
 .../iotdb/confignode/manager/ConfigManager.java    |  62 ++--
 .../apache/iotdb/confignode/manager/IManager.java  |  17 ++
 .../iotdb/confignode/manager/NodeManager.java      |  44 ++-
 .../iotdb/confignode/manager/PartitionManager.java |  12 +-
 .../iotdb/confignode/manager/load/LoadManager.java |   4 +-
 .../manager/load/balancer/RegionBalancer.java      |   6 +-
 .../iotdb/confignode/persistence/NodeInfo.java     |  28 +-
 .../persistence/executor/ConfigPlanExecutor.java   |   7 +-
 .../persistence/partition/PartitionInfo.java       |  32 +-
 .../partition/StorageGroupPartitionTable.java      |  66 ++--
 .../thrift/ConfigNodeRPCServiceProcessor.java      |  29 +-
 .../request/ConfigPhysicalPlanSerDeTest.java       |  30 +-
 .../confignode/persistence/PartitionInfoTest.java  |  18 +-
 .../thrift/ConfigNodeRPCServiceProcessorTest.java  |  73 +++--
 docs/UserGuide/Query-Data/Query-Filter.md          |   7 +-
 docs/zh/UserGuide/Query-Data/Query-Filter.md       |  13 +-
 .../apache/iotdb/db/it/IoTDBFilterBetweenIT.java   | 179 +++++++++++
 .../org/apache/iotdb/db/it/IoTDBFilterNullIT.java  |   2 +-
 .../org/apache/iotdb/db/it/IoTDBNestedQueryIT.java |  72 +++++
 .../db/it/IoTDBSyntaxConventionIdentifierIT.java   |   4 -
 .../iotdb/db/integration/IoTDBNestedQueryIT.java   |  38 +++
 .../IoTDBSyntaxConventionIdentifierIT.java         |   4 -
 openapi/pom.xml                                    |  26 ++
 .../apache/iotdb/db/client/ConfigNodeClient.java   |  65 +---
 .../db/mpp/plan/analyze/ExpressionAnalyzer.java    | 257 ++++++++++++++--
 .../iotdb/db/mpp/plan/analyze/ExpressionUtils.java |  73 +++++
 .../iotdb/db/mpp/plan/expression/Expression.java   |   5 +-
 .../db/mpp/plan/expression/ExpressionType.java     |   2 +-
 .../plan/expression/ternary/BetweenExpression.java | 110 +++++++
 .../plan/expression/ternary/TernaryExpression.java | 336 +++++++++++++++++++++
 .../iotdb/db/mpp/plan/parser/ASTVisitor.java       |  17 +-
 .../dag/transformer/Transformer.java               |  21 ++
 .../transformer/ternary/BetweenTransformer.java    |  67 ++++
 .../ternary/CompareTernaryTransformer.java         |  86 ++++++
 .../transformer/ternary/TernaryTransformer.java    | 265 ++++++++++++++++
 .../iotdb/db/protocol/mpprest/MPPRestService.java  | 162 ++++++++++
 .../protocol/mpprest/filter/ApiOriginFilter.java   |  45 +++
 .../mpprest/filter/AuthorizationFilter.java        | 138 +++++++++
 .../mpprest/filter/BasicSecurityContext.java       |  56 ++++
 .../iotdb/db/protocol/mpprest/filter/User.java     |  38 +++
 .../db/protocol/mpprest/filter/UserCache.java      |  56 ++++
 .../mpprest/handler/AuthorizationHandler.java      |  47 +++
 .../protocol/mpprest/handler/ExceptionHandler.java |  75 +++++
 .../mpprest/handler/QueryDataSetHandler.java       | 252 ++++++++++++++++
 .../mpprest/handler/RequestValidationHandler.java  |  53 ++++
 .../handler/StatementConstructionHandler.java      | 157 ++++++++++
 .../mpprest/impl/GrafanaApiServiceImpl.java        | 245 +++++++++++++++
 .../protocol/mpprest/impl/PingApiServiceImpl.java  |  51 ++++
 .../protocol/mpprest/impl/RestApiServiceImpl.java  | 193 ++++++++++++
 .../apache/iotdb/db/qp/sql/IoTDBSqlVisitor.java    |  37 ++-
 .../java/org/apache/iotdb/db/service/DataNode.java |  69 ++---
 .../java/org/apache/iotdb/db/service/NewIoTDB.java |   4 +-
 .../java/org/apache/iotdb/rpc/TSStatusCode.java    |   3 +-
 thrift-commons/src/main/thrift/common.thrift       |  16 +-
 .../src/main/thrift/confignode.thrift              |  17 +-
 .../iotdb/tsfile/read/filter/TimeFilter.java       |  12 +
 .../tsfile/read/filter/factory/FilterFactory.java  |   4 +
 .../read/filter/factory/FilterSerializeId.java     |   3 +-
 .../iotdb/tsfile/read/filter/operator/Between.java | 141 +++++++++
 71 files changed, 3888 insertions(+), 327 deletions(-)