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

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


The following commit(s) were added to refs/heads/master by this push:
     new 63df0f1c9ff Make ErrMsg more readable when the predicate has too many 
conjunctions because of too many devices
63df0f1c9ff is described below

commit 63df0f1c9ff3bde3fe56abab21f292242dd57af7
Author: Weihao Li <[email protected]>
AuthorDate: Thu Aug 21 19:53:20 2025 +0800

    Make ErrMsg more readable when the predicate has too many conjunctions 
because of too many devices
---
 .../iotdb/db/queryengine/plan/analyze/PredicateUtils.java     | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/PredicateUtils.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/PredicateUtils.java
index cf4b3a8294c..381e8cfb5a0 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/PredicateUtils.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/PredicateUtils.java
@@ -21,6 +21,7 @@ package org.apache.iotdb.db.queryengine.plan.analyze;
 
 import org.apache.iotdb.commons.path.MeasurementPath;
 import org.apache.iotdb.commons.path.PartialPath;
+import org.apache.iotdb.db.exception.sql.SemanticException;
 import org.apache.iotdb.db.queryengine.plan.expression.Expression;
 import org.apache.iotdb.db.queryengine.plan.expression.ExpressionFactory;
 import org.apache.iotdb.db.queryengine.plan.expression.ExpressionType;
@@ -345,8 +346,14 @@ public class PredicateUtils {
     if (conjuncts.size() == 2) {
       return new LogicAndExpression(conjuncts.get(0), conjuncts.get(1));
     } else {
-      return new LogicAndExpression(
-          conjuncts.get(0), constructRightDeepTreeWithAnd(conjuncts.subList(1, 
conjuncts.size())));
+      try {
+        return new LogicAndExpression(
+            conjuncts.get(0),
+            constructRightDeepTreeWithAnd(conjuncts.subList(1, 
conjuncts.size())));
+      } catch (StackOverflowError e) {
+        throw new SemanticException(
+            "There are too many conjuncts in predicate after rewriting, this 
may be caused by too many devices, try to use ALIGN BY DEVICE");
+      }
     }
   }
 

Reply via email to