You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2023/06/20 10:00:55 UTC

[iotdb] branch rel/1.2 updated: forbid group by tags query on view (#10238)

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

qiaojialin pushed a commit to branch rel/1.2
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/rel/1.2 by this push:
     new cb817b77dd9 forbid group by tags query on view (#10238)
cb817b77dd9 is described below

commit cb817b77dd99ddf5913197ed8994dc511c24a120
Author: Marcos_Zyk <38...@users.noreply.github.com>
AuthorDate: Tue Jun 20 18:00:49 2023 +0800

    forbid group by tags query on view (#10238)
---
 .../org/apache/iotdb/db/mpp/plan/analyze/AnalyzeVisitor.java     | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/AnalyzeVisitor.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/AnalyzeVisitor.java
index 94d6e0a483b..81256440c58 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/AnalyzeVisitor.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/AnalyzeVisitor.java
@@ -269,8 +269,13 @@ public class AnalyzeVisitor extends StatementVisitor<Analysis, MPPQueryContext>
 
         // make sure paths in logical view is fetched
         updateSchemaTreeByViews(analysis, schemaTree);
-        if (analysis.useLogicalView() && queryStatement.isAlignByDevice()) {
-          throw new SemanticException("Views cannot be used in ALIGN BY DEVICE query yet.");
+        if (analysis.useLogicalView()) {
+          if (queryStatement.isAlignByDevice()) {
+            throw new SemanticException("Views cannot be used in ALIGN BY DEVICE query yet.");
+          }
+          if (queryStatement.isGroupByTag()) {
+            throw new SemanticException("Views cannot be used in GROUP BY TAGS query yet.");
+          }
         }
       } finally {
         logger.debug("[EndFetchSchema]");