This is an automated email from the ASF dual-hosted git repository.
hui pushed a commit to branch ml/windowSet
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/ml/windowSet by this push:
new e8c8d355f8 add semantic check
e8c8d355f8 is described below
commit e8c8d355f8195d7ad3e2a622ecfffa00eed137ac
Author: Minghui Liu <[email protected]>
AuthorDate: Tue Nov 15 17:07:46 2022 +0800
add semantic check
---
.../db/mpp/plan/statement/crud/FetchWindowBatchStatement.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git
a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/crud/FetchWindowBatchStatement.java
b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/crud/FetchWindowBatchStatement.java
index 756c5cc86d..58c6e596e3 100644
---
a/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/crud/FetchWindowBatchStatement.java
+++
b/server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/crud/FetchWindowBatchStatement.java
@@ -20,11 +20,13 @@
package org.apache.iotdb.db.mpp.plan.statement.crud;
import org.apache.iotdb.commons.path.PartialPath;
+import org.apache.iotdb.db.exception.sql.SemanticException;
import org.apache.iotdb.db.mpp.plan.constant.StatementType;
import
org.apache.iotdb.db.mpp.plan.planner.plan.parameter.GroupByTimeParameter;
import org.apache.iotdb.db.mpp.plan.statement.Statement;
import org.apache.iotdb.db.mpp.plan.statement.StatementVisitor;
+import java.util.HashSet;
import java.util.List;
public class FetchWindowBatchStatement extends Statement {
@@ -81,5 +83,9 @@ public class FetchWindowBatchStatement extends Statement {
return visitor.visitFetchWindowBatch(this, context);
}
- public void semanticCheck() {}
+ public void semanticCheck() {
+ if (samplingIndexes.size() > new HashSet<>(samplingIndexes).size()) {
+ throw new SemanticException("The index of the sampling window is not
allowed to be repeated");
+ }
+ }
}