You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2021/11/09 02:46:32 UTC

[iotdb] branch toomanypaths created (now 0a6ef29)

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

xiangweiwei pushed a change to branch toomanypaths
in repository https://gitbox.apache.org/repos/asf/iotdb.git.


      at 0a6ef29  MaxQueryDeduplicatedPathNum not take effect

This branch includes the following new commits:

     new 0a6ef29  MaxQueryDeduplicatedPathNum not take effect

The 1 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] 01/01: MaxQueryDeduplicatedPathNum not take effect

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

xiangweiwei pushed a commit to branch toomanypaths
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 0a6ef29e6186dfd19340de7c541177b163cd115d
Author: Alima777 <wx...@gmail.com>
AuthorDate: Tue Nov 9 10:45:43 2021 +0800

    MaxQueryDeduplicatedPathNum not take effect
---
 .../iotdb/db/exception/query/PathNumOverLimitException.java    |  6 ++++--
 .../iotdb/db/qp/strategy/optimizer/ConcatPathOptimizer.java    | 10 +++++-----
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/exception/query/PathNumOverLimitException.java b/server/src/main/java/org/apache/iotdb/db/exception/query/PathNumOverLimitException.java
index c4eb10f..c9efadf 100644
--- a/server/src/main/java/org/apache/iotdb/db/exception/query/PathNumOverLimitException.java
+++ b/server/src/main/java/org/apache/iotdb/db/exception/query/PathNumOverLimitException.java
@@ -19,12 +19,14 @@
 
 package org.apache.iotdb.db.exception.query;
 
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+
 public class PathNumOverLimitException extends QueryProcessException {
 
-  public PathNumOverLimitException(long maxDeduplicatedPathNum) {
+  public PathNumOverLimitException() {
     super(
         String.format(
             "Too many paths in one query! Currently allowed max deduplicated path number is %d. Please use slimit or adjust max_deduplicated_path_num in iotdb-engine.properties.",
-            maxDeduplicatedPathNum));
+            IoTDBDescriptor.getInstance().getConfig().getMaxQueryDeduplicatedPathNum()));
   }
 }
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/ConcatPathOptimizer.java b/server/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/ConcatPathOptimizer.java
index 0a03ea6..9427a21 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/ConcatPathOptimizer.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/ConcatPathOptimizer.java
@@ -445,14 +445,14 @@ public class ConcatPathOptimizer implements ILogicalOptimizer {
           }
         }
 
+        if (newSuffixPathList.size()
+            > IoTDBDescriptor.getInstance().getConfig().getMaxQueryDeduplicatedPathNum()) {
+          throw new PathNumOverLimitException();
+        }
         if (limit == 0) {
-          int maxDeduplicatedPathNum =
-              IoTDBDescriptor.getInstance().getConfig().getMaxQueryDeduplicatedPathNum();
-          if (maxDeduplicatedPathNum < newSuffixPathList.size()) {
-            throw new PathNumOverLimitException(maxDeduplicatedPathNum);
-          }
           break;
         }
+
       } catch (MetadataException e) {
         throw new LogicalOptimizeException("error when remove star: " + e.getMessage());
       }