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 2023/11/16 01:05:30 UTC

(iotdb) branch IOTDB-6243 updated: [IOTDB-6243] Support time duration threshold in fill(PREVIOUS) clause

This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch IOTDB-6243
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/IOTDB-6243 by this push:
     new a9998653d2f [IOTDB-6243] Support time duration threshold in fill(PREVIOUS) clause
a9998653d2f is described below

commit a9998653d2fac6434d982896e8b243f3d78922ac
Author: JackieTien97 <ja...@gmail.com>
AuthorDate: Thu Nov 16 09:05:20 2023 +0800

    [IOTDB-6243] Support time duration threshold in fill(PREVIOUS) clause
---
 .../db/it/fill/IoTDBFillWithThresholdInMSIT.java   | 36 +++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/fill/IoTDBFillWithThresholdInMSIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/fill/IoTDBFillWithThresholdInMSIT.java
index 158ffddf204..3a6fe3218dd 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/fill/IoTDBFillWithThresholdInMSIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/fill/IoTDBFillWithThresholdInMSIT.java
@@ -69,7 +69,7 @@ public class IoTDBFillWithThresholdInMSIT {
   }
 
   @Test
-  public void testFill() {
+  public void testPreviousFill() {
 
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
@@ -198,6 +198,40 @@ public class IoTDBFillWithThresholdInMSIT {
     }
   }
 
+  @Test
+  public void testLinearFill() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+
+      try (ResultSet set =
+          statement.executeQuery(
+              "SELECT last_value(*) FROM root.fillTest.d0 group by((2023-02-01T11:47:00.000+08:00, 2023-02-01T11:58:00.000+08:00], 1m) FILL(LINEAR, 2m)")) {
+        fail("FILL(LINEAR) doesn't support second parameter");
+      }
+    } catch (SQLException e) {
+      assertEquals(
+          "701: Only FILL(PREVIOUS) support specifying the time duration threshold.",
+          e.getMessage());
+    }
+  }
+
+  @Test
+  public void testConstantFill() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+
+      try (ResultSet set =
+          statement.executeQuery(
+              "SELECT last_value(s0) FROM root.fillTest.d0 group by((2023-02-01T11:47:00.000+08:00, 2023-02-01T11:58:00.000+08:00], 1m) FILL(2, 2m)")) {
+        fail("FILL(CONSTANT_VALUE) doesn't support second parameter");
+      }
+    } catch (SQLException e) {
+      assertEquals(
+          "701: Only FILL(PREVIOUS) support specifying the time duration threshold.",
+          e.getMessage());
+    }
+  }
+
   private void prepareData() {
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {