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

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

commit df5d9e4eb6454d3042e5d5e98c3d681a9919f605
Author: Minghui Liu <[email protected]>
AuthorDate: Wed Sep 14 10:19:08 2022 +0800

    add semantic check
---
 .../db/mpp/plan/statement/crud/QueryStatement.java    | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git 
a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/crud/QueryStatement.java
 
b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/crud/QueryStatement.java
index 97b355d2e3..1d4490ce3c 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/crud/QueryStatement.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/crud/QueryStatement.java
@@ -280,6 +280,10 @@ public class QueryStatement extends Statement {
     return orderByComponent.getSortItemList();
   }
 
+  public boolean isSelectInto() {
+    return intoComponent != null;
+  }
+
   public void semanticCheck() {
     if (isAggregationQuery()) {
       if (disableAlign()) {
@@ -371,6 +375,21 @@ public class QueryStatement extends Statement {
             "Sorting by device is only supported in ALIGN BY DEVICE queries.");
       }
     }
+
+    if (isSelectInto()) {
+      if (getSeriesLimit() > 0) {
+        throw new SemanticException("select into: slimit clauses are not 
supported.");
+      }
+      if (getSeriesOffset() > 0) {
+        throw new SemanticException("select into: soffset clauses are not 
supported.");
+      }
+      if (disableAlign()) {
+        throw new SemanticException("select into: disable align clauses are 
not supported.");
+      }
+      if (isLastQuery()) {
+        throw new SemanticException("select into: last clauses are not 
supported.");
+      }
+    }
   }
 
   @Override

Reply via email to