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/05/30 11:44:29 UTC

[iotdb] branch lmh/GroupByDebug created (now b1dd10912d)

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

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


      at b1dd10912d throw SemanticException in ASTVisitor

This branch includes the following new commits:

     new d142da0ecd fix faulty result in group by query
     new 194279520e add a semantic check
     new b1dd10912d throw SemanticException in ASTVisitor

The 3 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] 02/03: add a 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/GroupByDebug
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 194279520ea03e8abb9b1b5c34993abbfea523d3
Author: liuminghui233 <54...@qq.com>
AuthorDate: Mon May 30 19:43:31 2022 +0800

    add a semantic check
---
 .../org/apache/iotdb/db/mpp/plan/statement/crud/QueryStatement.java   | 4 ++++
 1 file changed, 4 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 35a565f3e7..2c1d8cb2fb 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
@@ -240,6 +240,10 @@ public class QueryStatement extends Statement {
           throw new SemanticException("Raw data and aggregation hybrid query is not supported.");
         }
       }
+    } else {
+      if (isGroupByTime() || isGroupByLevel()) {
+        throw new SemanticException("Raw data query doesn't support GROUP BY.");
+      }
     }
 
     if (isAlignByDevice()) {


[iotdb] 01/03: fix faulty result in group by 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/GroupByDebug
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit d142da0ecdbafc339854f4bbdfd5ecc1e1a3dbb9
Author: liuminghui233 <54...@qq.com>
AuthorDate: Mon May 30 19:32:00 2022 +0800

    fix faulty result in group by query
---
 .../aggregation/slidingwindow/SmoothQueueSlidingWindowAggregator.java    | 1 +
 1 file changed, 1 insertion(+)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/aggregation/slidingwindow/SmoothQueueSlidingWindowAggregator.java b/server/src/main/java/org/apache/iotdb/db/mpp/aggregation/slidingwindow/SmoothQueueSlidingWindowAggregator.java
index 0d82e0169d..adfe1528c8 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/aggregation/slidingwindow/SmoothQueueSlidingWindowAggregator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/aggregation/slidingwindow/SmoothQueueSlidingWindowAggregator.java
@@ -39,6 +39,7 @@ public class SmoothQueueSlidingWindowAggregator extends SlidingWindowAggregator
   protected void evictingExpiredValue() {
     if (!deque.isEmpty() && !curTimeRange.contains(deque.getLast().getTime())) {
       this.accumulator.reset();
+      deque.clear();
       return;
     }
     while (!deque.isEmpty() && !curTimeRange.contains(deque.getFirst().getTime())) {


[iotdb] 03/03: throw SemanticException in ASTVisitor

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

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

commit b1dd10912d618b772b396194ab2672fc17611610
Author: liuminghui233 <54...@qq.com>
AuthorDate: Mon May 30 19:43:58 2022 +0800

    throw SemanticException in ASTVisitor
---
 .../thrift/impl/DataNodeTSIServiceImpl.java        | 24 +++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/DataNodeTSIServiceImpl.java b/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/DataNodeTSIServiceImpl.java
index 547e86dd6c..412301327f 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/DataNodeTSIServiceImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/DataNodeTSIServiceImpl.java
@@ -530,20 +530,20 @@ public class DataNodeTSIServiceImpl implements TSIEventHandler {
     }
 
     long startTime = System.currentTimeMillis();
-    Statement s =
-        StatementGenerator.createStatement(
-            statement, SESSION_MANAGER.getZoneId(req.getSessionId()));
-
-    // permission check
-    TSStatus status = AuthorityChecker.checkAuthority(s, req.sessionId);
-    if (status.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
-      return RpcUtils.getTSExecuteStatementResp(status);
-    }
+    try {
+      Statement s =
+          StatementGenerator.createStatement(
+              statement, SESSION_MANAGER.getZoneId(req.getSessionId()));
 
-    QUERY_FREQUENCY_RECORDER.incrementAndGet();
-    AUDIT_LOGGER.debug("Session {} execute Query: {}", req.sessionId, statement);
+      // permission check
+      TSStatus status = AuthorityChecker.checkAuthority(s, req.sessionId);
+      if (status.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+        return RpcUtils.getTSExecuteStatementResp(status);
+      }
+
+      QUERY_FREQUENCY_RECORDER.incrementAndGet();
+      AUDIT_LOGGER.debug("Session {} execute Query: {}", req.sessionId, statement);
 
-    try {
       long queryId = SESSION_MANAGER.requestQueryId(req.statementId, true);
       // create and cache dataset
       ExecutionResult result =