You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2024/11/07 11:51:54 UTC
(iotdb) branch master updated: Modify errMsg of unsupported subquery
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 f5d18323330 Modify errMsg of unsupported subquery
f5d18323330 is described below
commit f5d1832333019d10d8f837377faf3791db7ce674
Author: Weihao Li <60...@users.noreply.github.com>
AuthorDate: Thu Nov 7 19:51:49 2024 +0800
Modify errMsg of unsupported subquery
---
.../relational/it/query/recent/IoTDBTableAggregationIT.java | 9 +++++++++
.../iotdb/db/queryengine/plan/relational/sql/ast/AstVisitor.java | 4 +++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBTableAggregationIT.java b/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBTableAggregationIT.java
index 4d39663d5ec..c5960b0148d 100644
--- a/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBTableAggregationIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBTableAggregationIT.java
@@ -31,6 +31,7 @@ import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import static org.apache.iotdb.db.it.utils.TestUtils.prepareTableData;
+import static org.apache.iotdb.db.it.utils.TestUtils.tableAssertTestFail;
import static org.apache.iotdb.db.it.utils.TestUtils.tableResultSetEqualTest;
import static org.apache.iotdb.relational.it.db.it.IoTDBMultiIDsWithAttributesTableIT.buildHeaders;
@@ -3645,4 +3646,12 @@ public class IoTDBTableAggregationIT {
retArray,
DATABASE_NAME);
}
+
+ @Test
+ public void exceptionTest() {
+ tableAssertTestFail(
+ "select s1 from table1 where s2 in (select s2 from table1)",
+ "701: Only TableSubquery is supported now",
+ DATABASE_NAME);
+ }
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/AstVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/AstVisitor.java
index fb8ebd09fac..66bcd7a43e2 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/AstVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/AstVisitor.java
@@ -19,6 +19,8 @@
package org.apache.iotdb.db.queryengine.plan.relational.sql.ast;
+import org.apache.iotdb.db.exception.sql.SemanticException;
+
import javax.annotation.Nullable;
public abstract class AstVisitor<R, C> {
@@ -260,7 +262,7 @@ public abstract class AstVisitor<R, C> {
}
protected R visitSubqueryExpression(SubqueryExpression node, C context) {
- return visitExpression(node, context);
+ throw new SemanticException("Only TableSubquery is supported now");
}
protected R visitSortItem(SortItem node, C context) {