[GitHub] [incubator-iotdb] LeiRui commented on a change in pull request #443: [IOTDB-240] fix unknown time series in where clause
LeiRui commented on a change in pull request #443: [IOTDB-240] fix unknown time series in where clause URL: https://github.com/apache/incubator-iotdb/pull/443#discussion_r334215980 ## File path: server/src/main/java/org/apache/iotdb/db/metadata/MTree.java ## @@ -512,8 +512,7 @@ private MNode checkPath(String path) throws PathErrorException { MNode cur = getRoot(); for (int i = 1; i < nodes.length; i++) { if (!cur.hasChild(nodes[i])) { -throw new PathErrorException( -String.format(NO_CHILD_ERROR,cur.getName(),nodes[i])); +throw new PathErrorException("Path: \"" + path + "\" doesn't corresponding to any known time series"); Review comment: grammar: doesn't correspond to This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-iotdb] LeiRui commented on a change in pull request #443: [IOTDB-240] fix unknown time series in where clause
LeiRui commented on a change in pull request #443: [IOTDB-240] fix unknown time series in where clause URL: https://github.com/apache/incubator-iotdb/pull/443#discussion_r334217520 ## File path: server/src/test/java/org/apache/iotdb/db/integration/IoTDBMultiSeriesIT.java ## @@ -334,4 +334,32 @@ public void crossSeriesReadUpdateTest() throws ClassNotFoundException, SQLExcept fail(e.getMessage()); } } + + @Test + public void selectUnknownTimeSeries() throws ClassNotFoundException { +Class.forName(Config.JDBC_DRIVER_NAME); + +try (Connection connection = DriverManager +.getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root"); +Statement statement = connection.createStatement()) { + statement.execute("select s10 from root.vehicle.d0"); + fail("not throw exception when select unknown time series"); +} catch (SQLException e) { + assertEquals("Execute statement error: Path: \"root.vehicle.d0.s10\" doesn't corresponding to any known time series", e.getMessage()); +} + } + + @Test + public void selectWhereUnknownTimeSeries() throws ClassNotFoundException { +Class.forName(Config.JDBC_DRIVER_NAME); + +try (Connection connection = DriverManager +.getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root"); +Statement statement = connection.createStatement()) { + statement.execute("select s1 from root.vehicle.d0 where s0 < 111 and s10 < 111"); Review comment: Better add a test for the case where filter paths start with ROOT. Correspond to the error exception you add in the class `MTree`. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-iotdb] LeiRui commented on a change in pull request #443: [IOTDB-240] fix unknown time series in where clause
LeiRui commented on a change in pull request #443: [IOTDB-240] fix unknown time series in where clause URL: https://github.com/apache/incubator-iotdb/pull/443#discussion_r334215980 ## File path: server/src/main/java/org/apache/iotdb/db/metadata/MTree.java ## @@ -512,8 +512,7 @@ private MNode checkPath(String path) throws PathErrorException { MNode cur = getRoot(); for (int i = 1; i < nodes.length; i++) { if (!cur.hasChild(nodes[i])) { -throw new PathErrorException( -String.format(NO_CHILD_ERROR,cur.getName(),nodes[i])); +throw new PathErrorException("Path: \"" + path + "\" doesn't corresponding to any known time series"); Review comment: grammar: doesn't correspond to This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services