This is an automated email from the ASF dual-hosted git repository.
rong pushed a commit to branch select-into
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/select-into by this push:
new 98c9e69 add tests
98c9e69 is described below
commit 98c9e69878218d63891c9932eb9f9dabab7cd519
Author: Steve Yurong Su <[email protected]>
AuthorDate: Thu Jul 22 10:15:40 2021 +0800
add tests
---
.../db/qp/logical/crud/SelectIntoOperator.java | 7 +--
.../iotdb/db/integration/IoTDBSelectIntoIT.java | 61 +++++++++++++++++++++-
2 files changed, 64 insertions(+), 4 deletions(-)
diff --git
a/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/SelectIntoOperator.java
b/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/SelectIntoOperator.java
index 2bba539..d130ae6 100644
---
a/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/SelectIntoOperator.java
+++
b/server/src/main/java/org/apache/iotdb/db/qp/logical/crud/SelectIntoOperator.java
@@ -70,8 +70,8 @@ public class SelectIntoOperator extends Operator {
}
if (queryOperator instanceof AggregationQueryOperator
- && (!(queryOperator instanceof GroupByQueryOperator))
- || !(queryOperator instanceof GroupByFillQueryOperator)) {
+ && (!(queryOperator instanceof GroupByQueryOperator)
+ || !(queryOperator instanceof GroupByFillQueryOperator))) {
throw new LogicalOperatorException("select into: aggregation queries are
not supported.");
}
@@ -84,7 +84,8 @@ public class SelectIntoOperator extends Operator {
throw new LogicalOperatorException("select into: soffset clauses are
not supported.");
}
if (!specialClauseComponent.isAscending()) {
- throw new LogicalOperatorException("select into: descending clauses
are not supported.");
+ throw new LogicalOperatorException(
+ "select into: order by time desc clauses are not supported.");
}
}
}
diff --git
a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBSelectIntoIT.java
b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBSelectIntoIT.java
index 5ef1d23..5bbb308 100644
---
a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBSelectIntoIT.java
+++
b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBSelectIntoIT.java
@@ -192,7 +192,6 @@ public class IoTDBSelectIntoIT {
assertFalse(resultSet.next());
} catch (SQLException throwable) {
- throwable.printStackTrace();
fail(throwable.getMessage());
}
}
@@ -341,4 +340,64 @@ public class IoTDBSelectIntoIT {
assertTrue(throwable.getMessage().contains("the x of ${x} should be an
integer."));
}
}
+
+ @Test
+ public void testAlignByDevice() {
+ try (Statement statement =
+ DriverManager.getConnection(Config.IOTDB_URL_PREFIX +
"127.0.0.1:6667/", "root", "root")
+ .createStatement()) {
+ statement.execute("select s1 into root.${1}.s1 from root.sg.d1 align by
device");
+ fail();
+ } catch (SQLException throwable) {
+ assertTrue(throwable.getMessage().contains("align by device clauses are
not supported."));
+ }
+ }
+
+ @Test
+ public void testDisableDevice() {
+ try (Statement statement =
+ DriverManager.getConnection(Config.IOTDB_URL_PREFIX +
"127.0.0.1:6667/", "root", "root")
+ .createStatement()) {
+ statement.execute("select s1 into root.${1}.s1 from root.sg.d1 disable
align");
+ fail();
+ } catch (SQLException throwable) {
+ assertTrue(throwable.getMessage().contains("disable align clauses are
not supported."));
+ }
+ }
+
+ @Test
+ public void testLastQuery() {
+ try (Statement statement =
+ DriverManager.getConnection(Config.IOTDB_URL_PREFIX +
"127.0.0.1:6667/", "root", "root")
+ .createStatement()) {
+ statement.execute("select last s1 into root.${1}.s1 from root.sg.d1");
+ fail();
+ } catch (SQLException throwable) {
+ assertTrue(throwable.getMessage().contains("last clauses are not
supported."));
+ }
+ }
+
+ @Test
+ public void testSlimit() {
+ try (Statement statement =
+ DriverManager.getConnection(Config.IOTDB_URL_PREFIX +
"127.0.0.1:6667/", "root", "root")
+ .createStatement()) {
+ statement.execute("select s1, s2 into ${1}.s1, ${2}.s1 from root.sg.d1
slimit 1");
+ fail();
+ } catch (SQLException throwable) {
+ assertTrue(throwable.getMessage().contains("slimit clauses are not
supported."));
+ }
+ }
+
+ @Test
+ public void testDescending() {
+ try (Statement statement =
+ DriverManager.getConnection(Config.IOTDB_URL_PREFIX +
"127.0.0.1:6667/", "root", "root")
+ .createStatement()) {
+ statement.execute("select s1, s2 into ${1}.s1, ${2}.s1 from root.sg.d1
order by time desc");
+ fail();
+ } catch (SQLException throwable) {
+ assertTrue(throwable.getMessage().contains("desc clauses are not
supported."));
+ }
+ }
}