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 a67f1e4 [IOTDB-2139] Move example udfs to src/java package to pass
cluster IT (#4569)
a67f1e4 is described below
commit a67f1e49de2b9ae42d0079afbf151f93c4bd6dbd
Author: BaiJian <[email protected]>
AuthorDate: Tue Dec 14 12:32:46 2021 +0800
[IOTDB-2139] Move example udfs to src/java package to pass cluster IT
(#4569)
---
.../iotdb/db/query/udf/example/Accumulator.java | 30 +++++-------
.../apache/iotdb/db/query/udf/example/Adder.java | 0
.../apache/iotdb/db/query/udf/example/Counter.java | 39 +++++++---------
.../db/query/udf/example/ExampleUDFConstant.java | 31 +++++++++++++
.../org/apache/iotdb/db/query/udf/example/Max.java | 0
.../iotdb/db/query/udf/example/Multiplier.java | 0
.../SlidingSizeWindowConstructorTester0.java | 0
.../SlidingSizeWindowConstructorTester1.java | 0
.../SlidingTimeWindowConstructionTester.java | 4 +-
.../db/query/udf/example/TerminateTester.java | 0
.../iotdb/db/query/udf/example/ValidateTester.java | 0
.../iotdb/db/integration/IoTDBNestedQueryIT.java | 54 ++++++++++------------
.../db/integration/IoTDBUDFWindowQueryIT.java | 34 ++++++--------
.../db/integration/IoTDBUDTFHybridQueryIT.java | 12 ++---
14 files changed, 102 insertions(+), 102 deletions(-)
diff --git
a/integration/src/test/java/org/apache/iotdb/db/query/udf/example/Accumulator.java
b/integration/src/main/java/org/apache/iotdb/db/query/udf/example/Accumulator.java
similarity index 71%
rename from
integration/src/test/java/org/apache/iotdb/db/query/udf/example/Accumulator.java
rename to
integration/src/main/java/org/apache/iotdb/db/query/udf/example/Accumulator.java
index 031d003..cb6387f 100644
---
a/integration/src/test/java/org/apache/iotdb/db/query/udf/example/Accumulator.java
+++
b/integration/src/main/java/org/apache/iotdb/db/query/udf/example/Accumulator.java
@@ -37,16 +37,6 @@ import org.slf4j.LoggerFactory;
import java.io.IOException;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.ACCESS_STRATEGY_KEY;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.ACCESS_STRATEGY_ROW_BY_ROW;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.ACCESS_STRATEGY_SLIDING_SIZE;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.ACCESS_STRATEGY_SLIDING_TIME;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.DISPLAY_WINDOW_BEGIN_KEY;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.DISPLAY_WINDOW_END_KEY;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.SLIDING_STEP_KEY;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.TIME_INTERVAL_KEY;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.WINDOW_SIZE_KEY;
-
public class Accumulator implements UDTF {
private static final Logger logger =
LoggerFactory.getLogger(Accumulator.class);
@@ -60,20 +50,22 @@ public class Accumulator implements UDTF {
public void beforeStart(UDFParameters parameters, UDTFConfigurations
configurations) {
logger.debug("Accumulator#beforeStart");
configurations.setOutputDataType(TSDataType.INT32);
- switch (parameters.getStringOrDefault(ACCESS_STRATEGY_KEY,
ACCESS_STRATEGY_ROW_BY_ROW)) {
- case ACCESS_STRATEGY_SLIDING_SIZE:
+ switch (parameters.getStringOrDefault(
+ ExampleUDFConstant.ACCESS_STRATEGY_KEY,
ExampleUDFConstant.ACCESS_STRATEGY_ROW_BY_ROW)) {
+ case ExampleUDFConstant.ACCESS_STRATEGY_SLIDING_SIZE:
configurations.setAccessStrategy(
- new
SlidingSizeWindowAccessStrategy(parameters.getInt(WINDOW_SIZE_KEY)));
+ new SlidingSizeWindowAccessStrategy(
+ parameters.getInt(ExampleUDFConstant.WINDOW_SIZE_KEY)));
break;
- case ACCESS_STRATEGY_SLIDING_TIME:
+ case ExampleUDFConstant.ACCESS_STRATEGY_SLIDING_TIME:
configurations.setAccessStrategy(
new SlidingTimeWindowAccessStrategy(
- parameters.getLong(TIME_INTERVAL_KEY),
- parameters.getLong(SLIDING_STEP_KEY),
- parameters.getLong(DISPLAY_WINDOW_BEGIN_KEY),
- parameters.getLong(DISPLAY_WINDOW_END_KEY)));
+ parameters.getLong(ExampleUDFConstant.TIME_INTERVAL_KEY),
+ parameters.getLong(ExampleUDFConstant.SLIDING_STEP_KEY),
+
parameters.getLong(ExampleUDFConstant.DISPLAY_WINDOW_BEGIN_KEY),
+
parameters.getLong(ExampleUDFConstant.DISPLAY_WINDOW_END_KEY)));
break;
- case ACCESS_STRATEGY_ROW_BY_ROW:
+ case ExampleUDFConstant.ACCESS_STRATEGY_ROW_BY_ROW:
default:
configurations.setAccessStrategy(new RowByRowAccessStrategy());
}
diff --git
a/integration/src/test/java/org/apache/iotdb/db/query/udf/example/Adder.java
b/integration/src/main/java/org/apache/iotdb/db/query/udf/example/Adder.java
similarity index 100%
rename from
integration/src/test/java/org/apache/iotdb/db/query/udf/example/Adder.java
rename to
integration/src/main/java/org/apache/iotdb/db/query/udf/example/Adder.java
diff --git
a/integration/src/test/java/org/apache/iotdb/db/query/udf/example/Counter.java
b/integration/src/main/java/org/apache/iotdb/db/query/udf/example/Counter.java
similarity index 61%
rename from
integration/src/test/java/org/apache/iotdb/db/query/udf/example/Counter.java
rename to
integration/src/main/java/org/apache/iotdb/db/query/udf/example/Counter.java
index 1e7b316..6ca4dea 100644
---
a/integration/src/test/java/org/apache/iotdb/db/query/udf/example/Counter.java
+++
b/integration/src/main/java/org/apache/iotdb/db/query/udf/example/Counter.java
@@ -35,16 +35,6 @@ import org.slf4j.LoggerFactory;
import java.io.IOException;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.ACCESS_STRATEGY_KEY;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.ACCESS_STRATEGY_ROW_BY_ROW;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.ACCESS_STRATEGY_SLIDING_SIZE;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.ACCESS_STRATEGY_SLIDING_TIME;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.DISPLAY_WINDOW_BEGIN_KEY;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.DISPLAY_WINDOW_END_KEY;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.SLIDING_STEP_KEY;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.TIME_INTERVAL_KEY;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.WINDOW_SIZE_KEY;
-
public class Counter implements UDTF {
private static final Logger logger = LoggerFactory.getLogger(Counter.class);
@@ -53,24 +43,27 @@ public class Counter implements UDTF {
public void beforeStart(UDFParameters parameters, UDTFConfigurations
configurations) {
logger.debug("Counter#beforeStart");
configurations.setOutputDataType(TSDataType.INT32);
- switch (parameters.getStringOrDefault(ACCESS_STRATEGY_KEY,
ACCESS_STRATEGY_ROW_BY_ROW)) {
- case ACCESS_STRATEGY_SLIDING_SIZE:
+ switch (parameters.getStringOrDefault(
+ ExampleUDFConstant.ACCESS_STRATEGY_KEY,
ExampleUDFConstant.ACCESS_STRATEGY_ROW_BY_ROW)) {
+ case ExampleUDFConstant.ACCESS_STRATEGY_SLIDING_SIZE:
configurations.setAccessStrategy(
- new
SlidingSizeWindowAccessStrategy(parameters.getInt(WINDOW_SIZE_KEY)));
+ new SlidingSizeWindowAccessStrategy(
+ parameters.getInt(ExampleUDFConstant.WINDOW_SIZE_KEY)));
break;
- case ACCESS_STRATEGY_SLIDING_TIME:
+ case ExampleUDFConstant.ACCESS_STRATEGY_SLIDING_TIME:
configurations.setAccessStrategy(
- parameters.hasAttribute(SLIDING_STEP_KEY)
- && parameters.hasAttribute(DISPLAY_WINDOW_BEGIN_KEY)
- && parameters.hasAttribute(DISPLAY_WINDOW_END_KEY)
+ parameters.hasAttribute(ExampleUDFConstant.SLIDING_STEP_KEY)
+ &&
parameters.hasAttribute(ExampleUDFConstant.DISPLAY_WINDOW_BEGIN_KEY)
+ &&
parameters.hasAttribute(ExampleUDFConstant.DISPLAY_WINDOW_END_KEY)
? new SlidingTimeWindowAccessStrategy(
- parameters.getLong(TIME_INTERVAL_KEY),
- parameters.getLong(SLIDING_STEP_KEY),
- parameters.getLong(DISPLAY_WINDOW_BEGIN_KEY),
- parameters.getLong(DISPLAY_WINDOW_END_KEY))
- : new
SlidingTimeWindowAccessStrategy(parameters.getLong(TIME_INTERVAL_KEY)));
+ parameters.getLong(ExampleUDFConstant.TIME_INTERVAL_KEY),
+ parameters.getLong(ExampleUDFConstant.SLIDING_STEP_KEY),
+
parameters.getLong(ExampleUDFConstant.DISPLAY_WINDOW_BEGIN_KEY),
+
parameters.getLong(ExampleUDFConstant.DISPLAY_WINDOW_END_KEY))
+ : new SlidingTimeWindowAccessStrategy(
+ parameters.getLong(ExampleUDFConstant.TIME_INTERVAL_KEY)));
break;
- case ACCESS_STRATEGY_ROW_BY_ROW:
+ case ExampleUDFConstant.ACCESS_STRATEGY_ROW_BY_ROW:
default:
configurations.setAccessStrategy(new RowByRowAccessStrategy());
}
diff --git
a/integration/src/main/java/org/apache/iotdb/db/query/udf/example/ExampleUDFConstant.java
b/integration/src/main/java/org/apache/iotdb/db/query/udf/example/ExampleUDFConstant.java
new file mode 100644
index 0000000..87984d2
--- /dev/null
+++
b/integration/src/main/java/org/apache/iotdb/db/query/udf/example/ExampleUDFConstant.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iotdb.db.query.udf.example;
+
+public class ExampleUDFConstant {
+ public static final String ACCESS_STRATEGY_KEY = "access";
+ public static final String ACCESS_STRATEGY_ROW_BY_ROW = "row-by-row";
+ public static final String ACCESS_STRATEGY_SLIDING_SIZE = "size";
+ public static final String ACCESS_STRATEGY_SLIDING_TIME = "time";
+ public static final String WINDOW_SIZE_KEY = "windowSize";
+ public static final String TIME_INTERVAL_KEY = "timeInterval";
+ public static final String SLIDING_STEP_KEY = "slidingStep";
+ public static final String DISPLAY_WINDOW_BEGIN_KEY = "displayWindowBegin";
+ public static final String DISPLAY_WINDOW_END_KEY = "displayWindowEnd";
+}
diff --git
a/integration/src/test/java/org/apache/iotdb/db/query/udf/example/Max.java
b/integration/src/main/java/org/apache/iotdb/db/query/udf/example/Max.java
similarity index 100%
rename from
integration/src/test/java/org/apache/iotdb/db/query/udf/example/Max.java
rename to
integration/src/main/java/org/apache/iotdb/db/query/udf/example/Max.java
diff --git
a/integration/src/test/java/org/apache/iotdb/db/query/udf/example/Multiplier.java
b/integration/src/main/java/org/apache/iotdb/db/query/udf/example/Multiplier.java
similarity index 100%
rename from
integration/src/test/java/org/apache/iotdb/db/query/udf/example/Multiplier.java
rename to
integration/src/main/java/org/apache/iotdb/db/query/udf/example/Multiplier.java
diff --git
a/integration/src/test/java/org/apache/iotdb/db/query/udf/example/SlidingSizeWindowConstructorTester0.java
b/integration/src/main/java/org/apache/iotdb/db/query/udf/example/SlidingSizeWindowConstructorTester0.java
similarity index 100%
rename from
integration/src/test/java/org/apache/iotdb/db/query/udf/example/SlidingSizeWindowConstructorTester0.java
rename to
integration/src/main/java/org/apache/iotdb/db/query/udf/example/SlidingSizeWindowConstructorTester0.java
diff --git
a/integration/src/test/java/org/apache/iotdb/db/query/udf/example/SlidingSizeWindowConstructorTester1.java
b/integration/src/main/java/org/apache/iotdb/db/query/udf/example/SlidingSizeWindowConstructorTester1.java
similarity index 100%
rename from
integration/src/test/java/org/apache/iotdb/db/query/udf/example/SlidingSizeWindowConstructorTester1.java
rename to
integration/src/main/java/org/apache/iotdb/db/query/udf/example/SlidingSizeWindowConstructorTester1.java
diff --git
a/integration/src/test/java/org/apache/iotdb/db/query/udf/example/SlidingTimeWindowConstructionTester.java
b/integration/src/main/java/org/apache/iotdb/db/query/udf/example/SlidingTimeWindowConstructionTester.java
similarity index 94%
rename from
integration/src/test/java/org/apache/iotdb/db/query/udf/example/SlidingTimeWindowConstructionTester.java
rename to
integration/src/main/java/org/apache/iotdb/db/query/udf/example/SlidingTimeWindowConstructionTester.java
index fd10289..917811f 100644
---
a/integration/src/test/java/org/apache/iotdb/db/query/udf/example/SlidingTimeWindowConstructionTester.java
+++
b/integration/src/main/java/org/apache/iotdb/db/query/udf/example/SlidingTimeWindowConstructionTester.java
@@ -34,8 +34,6 @@ import org.slf4j.LoggerFactory;
import java.io.IOException;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.TIME_INTERVAL_KEY;
-
public class SlidingTimeWindowConstructionTester implements UDTF {
private static final Logger logger =
@@ -49,7 +47,7 @@ public class SlidingTimeWindowConstructionTester implements
UDTF {
@Override
public void beforeStart(UDFParameters parameters, UDTFConfigurations
configurations) {
logger.debug("SlidingTimeWindowConstructionTester#beforeStart");
- long timeInterval = parameters.getLong(TIME_INTERVAL_KEY);
+ long timeInterval =
parameters.getLong(ExampleUDFConstant.TIME_INTERVAL_KEY);
configurations
.setOutputDataType(TSDataType.INT32)
.setAccessStrategy(new SlidingTimeWindowAccessStrategy(timeInterval));
diff --git
a/integration/src/test/java/org/apache/iotdb/db/query/udf/example/TerminateTester.java
b/integration/src/main/java/org/apache/iotdb/db/query/udf/example/TerminateTester.java
similarity index 100%
rename from
integration/src/test/java/org/apache/iotdb/db/query/udf/example/TerminateTester.java
rename to
integration/src/main/java/org/apache/iotdb/db/query/udf/example/TerminateTester.java
diff --git
a/integration/src/test/java/org/apache/iotdb/db/query/udf/example/ValidateTester.java
b/integration/src/main/java/org/apache/iotdb/db/query/udf/example/ValidateTester.java
similarity index 100%
rename from
integration/src/test/java/org/apache/iotdb/db/query/udf/example/ValidateTester.java
rename to
integration/src/main/java/org/apache/iotdb/db/query/udf/example/ValidateTester.java
diff --git
a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBNestedQueryIT.java
b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBNestedQueryIT.java
index 2619013..01318af 100644
---
a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBNestedQueryIT.java
+++
b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBNestedQueryIT.java
@@ -22,6 +22,7 @@ package org.apache.iotdb.db.integration;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.exception.metadata.MetadataException;
import org.apache.iotdb.db.metadata.path.PartialPath;
+import org.apache.iotdb.db.query.udf.example.ExampleUDFConstant;
import org.apache.iotdb.db.service.IoTDB;
import org.apache.iotdb.db.utils.EnvironmentUtils;
import org.apache.iotdb.itbase.category.LocalStandaloneTest;
@@ -42,11 +43,6 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.ACCESS_STRATEGY_KEY;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.ACCESS_STRATEGY_SLIDING_SIZE;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.ACCESS_STRATEGY_SLIDING_TIME;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.TIME_INTERVAL_KEY;
-import static
org.apache.iotdb.db.integration.IoTDBUDFWindowQueryIT.WINDOW_SIZE_KEY;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.fail;
@@ -289,21 +285,21 @@ public class IoTDBNestedQueryIT {
String sqlStr =
String.format(
"select time_window_counter(sin(d1.s1), '%s'='%s', '%s'='%s'),
time_window_counter(sin(d1.s1), cos(d2.s2) / sin(d1.s1), d1.s2, '%s'='%s',
'%s'='%s'), size_window_counter(cos(d2.s2), '%s'='%s', '%s'='%s'),
size_window_counter(cos(d2.s2), cos(d2.s2), '%s'='%s', '%s'='%s') from
root.vehicle",
- ACCESS_STRATEGY_KEY,
- ACCESS_STRATEGY_SLIDING_TIME,
- TIME_INTERVAL_KEY,
+ ExampleUDFConstant.ACCESS_STRATEGY_KEY,
+ ExampleUDFConstant.ACCESS_STRATEGY_SLIDING_TIME,
+ ExampleUDFConstant.TIME_INTERVAL_KEY,
window,
- ACCESS_STRATEGY_KEY,
- ACCESS_STRATEGY_SLIDING_TIME,
- TIME_INTERVAL_KEY,
+ ExampleUDFConstant.ACCESS_STRATEGY_KEY,
+ ExampleUDFConstant.ACCESS_STRATEGY_SLIDING_TIME,
+ ExampleUDFConstant.TIME_INTERVAL_KEY,
window,
- ACCESS_STRATEGY_KEY,
- ACCESS_STRATEGY_SLIDING_SIZE,
- WINDOW_SIZE_KEY,
+ ExampleUDFConstant.ACCESS_STRATEGY_KEY,
+ ExampleUDFConstant.ACCESS_STRATEGY_SLIDING_SIZE,
+ ExampleUDFConstant.WINDOW_SIZE_KEY,
window,
- ACCESS_STRATEGY_KEY,
- ACCESS_STRATEGY_SLIDING_SIZE,
- WINDOW_SIZE_KEY,
+ ExampleUDFConstant.ACCESS_STRATEGY_KEY,
+ ExampleUDFConstant.ACCESS_STRATEGY_SLIDING_SIZE,
+ ExampleUDFConstant.WINDOW_SIZE_KEY,
window);
try (Connection connection =
@@ -359,21 +355,21 @@ public class IoTDBNestedQueryIT {
+ "size_window_counter(cos(empty), cos(empty), '%s'='%s',
'%s'='%s'), "
+ "empty, sin(empty) - bottom_k(top_k(empty, 'k'='111'),
'k'='111'), "
+ "empty * empty / empty + empty %% empty - empty from
root.vehicle",
- ACCESS_STRATEGY_KEY,
- ACCESS_STRATEGY_SLIDING_TIME,
- TIME_INTERVAL_KEY,
+ ExampleUDFConstant.ACCESS_STRATEGY_KEY,
+ ExampleUDFConstant.ACCESS_STRATEGY_SLIDING_TIME,
+ ExampleUDFConstant.TIME_INTERVAL_KEY,
window,
- ACCESS_STRATEGY_KEY,
- ACCESS_STRATEGY_SLIDING_TIME,
- TIME_INTERVAL_KEY,
+ ExampleUDFConstant.ACCESS_STRATEGY_KEY,
+ ExampleUDFConstant.ACCESS_STRATEGY_SLIDING_TIME,
+ ExampleUDFConstant.TIME_INTERVAL_KEY,
window,
- ACCESS_STRATEGY_KEY,
- ACCESS_STRATEGY_SLIDING_SIZE,
- WINDOW_SIZE_KEY,
+ ExampleUDFConstant.ACCESS_STRATEGY_KEY,
+ ExampleUDFConstant.ACCESS_STRATEGY_SLIDING_SIZE,
+ ExampleUDFConstant.WINDOW_SIZE_KEY,
window,
- ACCESS_STRATEGY_KEY,
- ACCESS_STRATEGY_SLIDING_SIZE,
- WINDOW_SIZE_KEY,
+ ExampleUDFConstant.ACCESS_STRATEGY_KEY,
+ ExampleUDFConstant.ACCESS_STRATEGY_SLIDING_SIZE,
+ ExampleUDFConstant.WINDOW_SIZE_KEY,
window);
try (Connection connection =
diff --git
a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBUDFWindowQueryIT.java
b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBUDFWindowQueryIT.java
index bdee424..5aff041 100644
---
a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBUDFWindowQueryIT.java
+++
b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBUDFWindowQueryIT.java
@@ -19,6 +19,7 @@
package org.apache.iotdb.db.integration;
+import org.apache.iotdb.db.query.udf.example.ExampleUDFConstant;
import org.apache.iotdb.integration.env.ConfigFactory;
import org.apache.iotdb.integration.env.EnvFactory;
import org.apache.iotdb.itbase.category.ClusterTest;
@@ -41,18 +42,6 @@ import static org.junit.Assert.fail;
@Category({LocalStandaloneTest.class, ClusterTest.class})
public class IoTDBUDFWindowQueryIT {
- public static final String ACCESS_STRATEGY_KEY = "access";
- public static final String ACCESS_STRATEGY_ROW_BY_ROW = "row-by-row";
- public static final String ACCESS_STRATEGY_SLIDING_SIZE = "size";
- public static final String ACCESS_STRATEGY_SLIDING_TIME = "time";
-
- public static final String WINDOW_SIZE_KEY = "windowSize";
-
- public static final String TIME_INTERVAL_KEY = "timeInterval";
- public static final String SLIDING_STEP_KEY = "slidingStep";
- public static final String DISPLAY_WINDOW_BEGIN_KEY = "displayWindowBegin";
- public static final String DISPLAY_WINDOW_END_KEY = "displayWindowEnd";
-
protected static final int ITERATION_TIMES = 100_000;
@BeforeClass
@@ -123,7 +112,7 @@ public class IoTDBUDFWindowQueryIT {
String sql =
String.format(
"select counter(s1, '%s'='%s') from root.vehicle.d1",
- ACCESS_STRATEGY_KEY, ACCESS_STRATEGY_ROW_BY_ROW);
+ ExampleUDFConstant.ACCESS_STRATEGY_KEY,
ExampleUDFConstant.ACCESS_STRATEGY_ROW_BY_ROW);
try (Connection conn = EnvFactory.getEnv().getConnection();
Statement statement = conn.createStatement()) {
@@ -183,7 +172,10 @@ public class IoTDBUDFWindowQueryIT {
String sql =
String.format(
"select accumulator(s1, '%s'='%s', '%s'='%s') from
root.vehicle.d1",
- ACCESS_STRATEGY_KEY, ACCESS_STRATEGY_SLIDING_SIZE,
WINDOW_SIZE_KEY, windowSize);
+ ExampleUDFConstant.ACCESS_STRATEGY_KEY,
+ ExampleUDFConstant.ACCESS_STRATEGY_SLIDING_SIZE,
+ ExampleUDFConstant.WINDOW_SIZE_KEY,
+ windowSize);
try (Connection conn = EnvFactory.getEnv().getConnection();
Statement statement = conn.createStatement()) {
@@ -304,15 +296,15 @@ public class IoTDBUDFWindowQueryIT {
String sql =
String.format(
"select accumulator(s1, s1, s1, '%s'='%s', '%s'='%s', '%s'='%s',
'%s'='%s', '%s'='%s') from root.vehicle.d1",
- ACCESS_STRATEGY_KEY,
- ACCESS_STRATEGY_SLIDING_TIME,
- TIME_INTERVAL_KEY,
+ ExampleUDFConstant.ACCESS_STRATEGY_KEY,
+ ExampleUDFConstant.ACCESS_STRATEGY_SLIDING_TIME,
+ ExampleUDFConstant.TIME_INTERVAL_KEY,
timeInterval,
- SLIDING_STEP_KEY,
+ ExampleUDFConstant.SLIDING_STEP_KEY,
slidingStep,
- DISPLAY_WINDOW_BEGIN_KEY,
+ ExampleUDFConstant.DISPLAY_WINDOW_BEGIN_KEY,
displayWindowBegin,
- DISPLAY_WINDOW_END_KEY,
+ ExampleUDFConstant.DISPLAY_WINDOW_END_KEY,
displayWindowEnd);
try (Connection conn = EnvFactory.getEnv().getConnection();
@@ -377,7 +369,7 @@ public class IoTDBUDFWindowQueryIT {
String sql =
String.format(
"select time_window_tester(s1, '%s'='%s') from root.vehicle.d1",
- TIME_INTERVAL_KEY, timeInterval);
+ ExampleUDFConstant.TIME_INTERVAL_KEY, timeInterval);
int displayWindowBegin = 0;
int displayWindowEnd = ITERATION_TIMES;
diff --git
a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBUDTFHybridQueryIT.java
b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBUDTFHybridQueryIT.java
index 160f0e2..e4929fa 100644
---
a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBUDTFHybridQueryIT.java
+++
b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBUDTFHybridQueryIT.java
@@ -19,6 +19,7 @@
package org.apache.iotdb.db.integration;
+import org.apache.iotdb.db.query.udf.example.ExampleUDFConstant;
import org.apache.iotdb.integration.env.EnvFactory;
import org.apache.iotdb.itbase.category.ClusterTest;
import org.apache.iotdb.itbase.category.LocalStandaloneTest;
@@ -38,9 +39,6 @@ import static org.junit.Assert.fail;
@Category({LocalStandaloneTest.class, ClusterTest.class})
public class IoTDBUDTFHybridQueryIT {
- public static final String ACCESS_STRATEGY_KEY = "access";
- public static final String ACCESS_STRATEGY_ROW_BY_ROW = "row-by-row";
-
@BeforeClass
public static void setUp() throws Exception {
EnvFactory.getEnv().initBeforeClass();
@@ -93,7 +91,7 @@ public class IoTDBUDTFHybridQueryIT {
String sql =
String.format(
"select count(*), counter(s1, '%s'='%s') from root.vehicle.d1",
- ACCESS_STRATEGY_KEY, ACCESS_STRATEGY_ROW_BY_ROW);
+ ExampleUDFConstant.ACCESS_STRATEGY_KEY,
ExampleUDFConstant.ACCESS_STRATEGY_ROW_BY_ROW);
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -112,7 +110,7 @@ public class IoTDBUDTFHybridQueryIT {
String sql =
String.format(
"select temperature, counter(temperature, '%s'='%s') from
root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(float [linear,
1m, 1m])",
- ACCESS_STRATEGY_KEY, ACCESS_STRATEGY_ROW_BY_ROW);
+ ExampleUDFConstant.ACCESS_STRATEGY_KEY,
ExampleUDFConstant.ACCESS_STRATEGY_ROW_BY_ROW);
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -129,7 +127,7 @@ public class IoTDBUDTFHybridQueryIT {
String sql =
String.format(
"select last counter(temperature, '%s'='%s') from
root.sgcc.wf03.wt01",
- ACCESS_STRATEGY_KEY, ACCESS_STRATEGY_ROW_BY_ROW);
+ ExampleUDFConstant.ACCESS_STRATEGY_KEY,
ExampleUDFConstant.ACCESS_STRATEGY_ROW_BY_ROW);
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -146,7 +144,7 @@ public class IoTDBUDTFHybridQueryIT {
String sql =
String.format(
"select adder(temperature), counter(temperature, '%s'='%s') from
root.sgcc.wf03.wt01 align by device",
- ACCESS_STRATEGY_KEY, ACCESS_STRATEGY_ROW_BY_ROW);
+ ExampleUDFConstant.ACCESS_STRATEGY_KEY,
ExampleUDFConstant.ACCESS_STRATEGY_ROW_BY_ROW);
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {