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 2020/11/16 05:29:08 UTC
[iotdb] branch master updated: Remove unnecessary delete path check
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 5b653a4 Remove unnecessary delete path check
new 84c1f9c Merge pull request #2056 from wshao08/del_fix
5b653a4 is described below
commit 5b653a48dfc00703ccb8611c8791378a7a95b795
Author: wshao08 <ko...@163.com>
AuthorDate: Mon Nov 16 11:55:31 2020 +0800
Remove unnecessary delete path check
---
.../apache/iotdb/db/qp/executor/PlanExecutor.java | 4 ---
.../iotdb/db/integration/IoTDBDeletionIT.java | 29 ++++++++++++++++++++++
2 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java b/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
index 6172e8c..fab4462 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
@@ -848,10 +848,6 @@ public class PlanExecutor implements IPlanExecutor {
public void delete(PartialPath path, long startTime, long endTime, long planIndex)
throws QueryProcessException {
try {
- if (!IoTDB.metaManager.isPathExist(path)) {
- throw new QueryProcessException(
- String.format("Time series %s does not exist.", path.getFullPath()));
- }
StorageEngine.getInstance().delete(path, startTime, endTime, planIndex);
} catch (StorageEngineException e) {
throw new QueryProcessException(e);
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBDeletionIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBDeletionIT.java
index 3f9daf7..3da375a 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBDeletionIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBDeletionIT.java
@@ -203,6 +203,35 @@ public class IoTDBDeletionIT {
}
@Test
+ public void testPartialPathRangeDelete() throws SQLException {
+ prepareData();
+ try (Connection connection = DriverManager
+ .getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root",
+ "root");
+ Statement statement = connection.createStatement()) {
+
+ statement.execute("DELETE FROM root.vehicle.d0.* WHERE time <= 300 and time > 150");
+ try (ResultSet set = statement.executeQuery("SELECT s0 FROM root.vehicle.d0")) {
+ int cnt = 0;
+ while (set.next()) {
+ cnt++;
+ }
+ assertEquals(250, cnt);
+ }
+
+ statement.execute("DELETE FROM root.vehicle.*.s0 WHERE time <= 100");
+ try (ResultSet set = statement.executeQuery("SELECT s0 FROM root.vehicle.d0")) {
+ int cnt = 0;
+ while (set.next()) {
+ cnt++;
+ }
+ assertEquals(150, cnt);
+ }
+ }
+ cleanData();
+ }
+
+ @Test
public void testDelFlushingMemtable() throws SQLException {
long size = IoTDBDescriptor.getInstance().getConfig().getMemtableSizeThreshold();
// Adjust memstable threshold size to make it flush automatically