You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2021/02/19 14:58:05 UTC
[iotdb] branch master updated: [ISSUE-2598] Throw explicit
exception when time series is unknown in where clause (#2599)
This is an automated email from the ASF dual-hosted git repository.
haonan 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 227c886 [ISSUE-2598] Throw explicit exception when time series is unknown in where clause (#2599)
227c886 is described below
commit 227c8865b275217c14937d9e2daca919043b0441
Author: Xiangwei Wei <34...@users.noreply.github.com>
AuthorDate: Fri Feb 19 22:57:43 2021 +0800
[ISSUE-2598] Throw explicit exception when time series is unknown in where clause (#2599)
* [ISSUE-2598] Fix IT failed caused by merge master
Co-authored-by: Haonan <hh...@outlook.com>
---
.../apache/iotdb/db/qp/strategy/optimizer/ConcatPathOptimizer.java | 4 ++++
.../java/org/apache/iotdb/db/integration/IoTDBMultiSeriesIT.java | 5 ++---
2 files changed, 6 insertions(+), 3 deletions(-)
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 c51285a..f74d82e 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
@@ -330,6 +330,10 @@ public class ConcatPathOptimizer implements ILogicalOptimizer {
try {
for (PartialPath path : paths) {
List<PartialPath> all = removeWildcard(path, 0, 0).left;
+ if (all.size() == 0) {
+ throw new LogicalOptimizeException(
+ String.format("Unknown time series %s in `where clause`", path));
+ }
for (PartialPath subPath : all) {
if (!pathSet.contains(subPath)) {
pathSet.add(subPath);
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBMultiSeriesIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBMultiSeriesIT.java
index e8b5668..ddf142f 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBMultiSeriesIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBMultiSeriesIT.java
@@ -452,9 +452,8 @@ public class IoTDBMultiSeriesIT {
statement.execute("select s0 from root.vehicle.d0 where s10 < 111");
fail("not throw exception when unknown time series in where clause");
} catch (SQLException e) {
- assertEquals(
- "411: Error occurred in query process: Filter has some time series don't correspond to any known time series",
- e.getMessage());
+ assertTrue(
+ e.getMessage().contains("Unknown time series root.vehicle.d0.s10 in `where clause`"));
}
}