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:51:39 UTC

[iotdb] branch toomanypaths2 created (now 0428c2f)

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

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


      at 0428c2f  MaxQueryDeduplicatedPathNum not take effect

This branch includes the following new commits:

     new 0428c2f  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 toomanypaths2
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 0428c2f71d442de08663d907bd17fc0c1518afbc
Author: Alima777 <wx...@gmail.com>
AuthorDate: Tue Nov 9 10:51:02 2021 +0800

    MaxQueryDeduplicatedPathNum not take effect
---
 .../iotdb/db/exception/query/PathNumOverLimitException.java  |  6 ++++--
 .../java/org/apache/iotdb/db/qp/utils/WildcardsRemover.java  | 12 ++++--------
 2 files changed, 8 insertions(+), 10 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 6f0539c..4f34d49 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(int maxQueryDeduplicatedPathNum) {
+  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.",
-            maxQueryDeduplicatedPathNum));
+            IoTDBDescriptor.getInstance().getConfig().getMaxQueryDeduplicatedPathNum())));
   }
 }
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/utils/WildcardsRemover.java b/server/src/main/java/org/apache/iotdb/db/qp/utils/WildcardsRemover.java
index 3fbc71c..ace7b4e 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/utils/WildcardsRemover.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/utils/WildcardsRemover.java
@@ -122,15 +122,11 @@ public class WildcardsRemover {
   /** @return should break the loop or not */
   public boolean checkIfPathNumberIsOverLimit(List<ResultColumn> resultColumns)
       throws PathNumOverLimitException {
-    int maxQueryDeduplicatedPathNum =
-        IoTDBDescriptor.getInstance().getConfig().getMaxQueryDeduplicatedPathNum();
-    if (currentLimit == 0) {
-      if (maxQueryDeduplicatedPathNum < resultColumns.size()) {
-        throw new PathNumOverLimitException(maxQueryDeduplicatedPathNum);
-      }
-      return true;
+    if (resultColumns.size()
+        > IoTDBDescriptor.getInstance().getConfig().getMaxQueryDeduplicatedPathNum()) {
+      throw new PathNumOverLimitException();
     }
-    return false;
+    return currentLimit == 0;
   }
 
   public void checkIfSoffsetIsExceeded(List<ResultColumn> resultColumns)