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 2026/02/12 07:51:28 UTC
(iotdb) branch rc/2.0.7 created (now 3ba95a80d46)
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a change to branch rc/2.0.7
in repository https://gitbox.apache.org/repos/asf/iotdb.git
at 3ba95a80d46 Pipe: Changed the separator check semantic for pipes / pipe plugins (#17175)
This branch includes the following new commits:
new ad5fc6d0cc9 Change default dn rpc address (#17060)
new 30a3879b7b6 chore!: Bind real config address for Thrift and Raft services (#16717)
new 618939cf10c Remove built-in jexl function in tree mode (#17092)
new e7c55304a71 [Bug fix] The partition table is cleaned incorrectly when set only device TTL for tree mode (#17123)
new 5d33826dc43 Pipe: Banned the illegal names in pipe and pipe plugins (#17145)
new 8fe6f510c91 Fixed the NPE when validating legacy sink (#17153)
new 3ba95a80d46 Pipe: Changed the separator check semantic for pipes / pipe plugins (#17175)
The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(iotdb) 04/07: [Bug fix] The partition table is cleaned incorrectly when set only device TTL for tree mode (#17123)
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch rc/2.0.7
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit e7c55304a71d22eea230f2d4577a39fdb882ed24
Author: Yongzao <yo...@apache.org>
AuthorDate: Fri Jan 30 23:08:27 2026 +0800
[Bug fix] The partition table is cleaned incorrectly when set only device TTL for tree mode (#17123)
(cherry picked from commit d703886e2c8ee24c54c013243e4a477497cc4e2f)
---
.../partition/IoTDBPartitionTableAutoCleanIT.java | 57 +++++++++++++++++++++-
.../iotdb/confignode/manager/TTLManager.java | 14 ++++++
.../iotdb/confignode/persistence/TTLInfo.java | 17 +++++++
.../procedure/PartitionTableAutoCleaner.java | 18 +++++--
.../apache/iotdb/commons/schema/ttl/TTLCache.java | 29 +++++++++++
5 files changed, 129 insertions(+), 6 deletions(-)
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionTableAutoCleanIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionTableAutoCleanIT.java
index 3f3596746f0..d150348c096 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionTableAutoCleanIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionTableAutoCleanIT.java
@@ -50,7 +50,7 @@ public class IoTDBPartitionTableAutoCleanIT {
private static final int TEST_REPLICATION_FACTOR = 1;
private static final long TEST_TIME_PARTITION_INTERVAL = 604800000;
- private static final long TEST_TTL_CHECK_INTERVAL = 5_000;
+ private static final long TEST_TTL_CHECK_INTERVAL_IN_MS = 5_00;
private static final TTimePartitionSlot TEST_CURRENT_TIME_SLOT =
new TTimePartitionSlot()
@@ -68,7 +68,7 @@ public class IoTDBPartitionTableAutoCleanIT {
.setSchemaReplicationFactor(TEST_REPLICATION_FACTOR)
.setDataReplicationFactor(TEST_REPLICATION_FACTOR)
.setTimePartitionInterval(TEST_TIME_PARTITION_INTERVAL)
- .setTTLCheckInterval(TEST_TTL_CHECK_INTERVAL);
+ .setTTLCheckInterval(TEST_TTL_CHECK_INTERVAL_IN_MS);
// Init 1C1D environment
EnvFactory.getEnv().initClusterEnvironment(1, 1);
@@ -135,6 +135,59 @@ public class IoTDBPartitionTableAutoCleanIT {
Assert.fail("The PartitionTable in the ConfigNode is not auto cleaned!");
}
+ @Test
+ public void testAutoCleanTakesNoEffectsForTreeDeviceTTL() throws Exception {
+ try (Connection connection = EnvFactory.getEnv().getConnection(BaseEnv.TREE_SQL_DIALECT);
+ Statement statement = connection.createStatement()) {
+ // Create databases and insert test data
+ for (int i = 0; i < 3; i++) {
+ String databaseName = String.format("%s%d", TREE_DATABASE_PREFIX, i);
+ statement.execute(String.format("CREATE DATABASE %s", databaseName));
+ statement.execute(
+ String.format(
+ "CREATE TIMESERIES %s.s WITH DATATYPE=INT64,ENCODING=PLAIN", databaseName));
+ // Insert expired data
+ statement.execute(
+ String.format(
+ "INSERT INTO %s(timestamp, s) VALUES (%d, %d)",
+ databaseName, TEST_CURRENT_TIME_SLOT.getStartTime() - TEST_TTL * 2, -1));
+ // Insert existed data
+ statement.execute(
+ String.format(
+ "INSERT INTO %s(timestamp, s) VALUES (%d, %d)",
+ databaseName, TEST_CURRENT_TIME_SLOT.getStartTime(), 1));
+ // Create an empty device and set a TTL.
+ // This TTL should not trigger the auto cleaner,
+ // since the database does not have a TTL.
+ statement.execute(
+ String.format(
+ "CREATE TIMESERIES %s.m.empty WITH DATATYPE=INT64,ENCODING=PLAIN", databaseName));
+ statement.execute(String.format("SET TTL TO %s.m.** %d", databaseName, TEST_TTL));
+ }
+ }
+
+ TDataPartitionReq req = new TDataPartitionReq();
+ for (int i = 0; i < 3; i++) {
+ req.putToPartitionSlotsMap(String.format("%s%d", TREE_DATABASE_PREFIX, i), new TreeMap<>());
+ }
+ try (SyncConfigNodeIServiceClient client =
+ (SyncConfigNodeIServiceClient) EnvFactory.getEnv().getLeaderConfigNodeConnection()) {
+ for (int retry = 0; retry < 10; retry++) {
+ // Ensure the partitions are not cleaned
+ boolean partitionTableAutoCleaned = false;
+ TDataPartitionTableResp resp = client.getDataPartitionTable(req);
+ if (TSStatusCode.SUCCESS_STATUS.getStatusCode() == resp.getStatus().getCode()) {
+ partitionTableAutoCleaned =
+ resp.getDataPartitionTable().entrySet().stream()
+ .flatMap(e1 -> e1.getValue().entrySet().stream())
+ .allMatch(e2 -> e2.getValue().size() == 1);
+ }
+ Assert.assertFalse(partitionTableAutoCleaned);
+ TimeUnit.SECONDS.sleep(1);
+ }
+ }
+ }
+
@Test
public void testAutoCleanPartitionTableForTableModel() throws Exception {
try (final Connection connection =
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/TTLManager.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/TTLManager.java
index e7ec400d0a9..b5c2e4900d7 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/TTLManager.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/TTLManager.java
@@ -130,6 +130,20 @@ public class TTLManager {
return ttlInfo.getTTLCount();
}
+ /**
+ * Get the maximum ttl of the corresponding database level.
+ *
+ * @param database the path of the database.
+ * @return the maximum ttl of the corresponding database level.
+ */
+ public long getDatabaseLevelTTL(final String database) {
+ final long ttl = ttlInfo.getDatabaseLevelTTL(database);
+ return ttl == Long.MAX_VALUE || ttl < 0
+ ? ttl
+ : CommonDateTimeUtils.convertMilliTimeWithPrecision(
+ ttl, CommonDescriptor.getInstance().getConfig().getTimestampPrecision());
+ }
+
/**
* Get the maximum ttl of the subtree of the corresponding database.
*
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/TTLInfo.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/TTLInfo.java
index 0d07f9414d4..f38e711f6d5 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/TTLInfo.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/TTLInfo.java
@@ -158,6 +158,23 @@ public class TTLInfo implements SnapshotProcessor {
}
}
+ /**
+ * Get the maximum ttl of the corresponding database level.
+ *
+ * @param database the path of the database.
+ * @return the maximum ttl of the corresponding database level.
+ */
+ public long getDatabaseLevelTTL(final String database) {
+ lock.readLock().lock();
+ try {
+ return ttlCache.getDatabaseLevelTTL(database);
+ } catch (IllegalPathException e) {
+ return TTLCache.NULL_TTL;
+ } finally {
+ lock.readLock().unlock();
+ }
+ }
+
/**
* Get the maximum ttl of the subtree of the corresponding database.
*
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/PartitionTableAutoCleaner.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/PartitionTableAutoCleaner.java
index 2ab15283207..84f12a78ec4 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/PartitionTableAutoCleaner.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/PartitionTableAutoCleaner.java
@@ -61,10 +61,20 @@ public class PartitionTableAutoCleaner<Env> extends InternalProcedure<Env> {
List<String> databases = configManager.getClusterSchemaManager().getDatabaseNames(null);
Map<String, Long> databaseTTLMap = new TreeMap<>();
for (String database : databases) {
- long databaseTTL =
- PathUtils.isTableModelDatabase(database)
- ? configManager.getClusterSchemaManager().getDatabaseMaxTTL(database)
- : configManager.getTTLManager().getDatabaseMaxTTL(database);
+ long databaseTTL;
+ if (PathUtils.isTableModelDatabase(database)) {
+ // For table mode, the auto cleaner takes effect
+ // when the maximum TTL among tables is less than Long.MAX_VALUE.
+ // Because the database-level TTL do not affect data in table mode.
+ databaseTTL = configManager.getClusterSchemaManager().getDatabaseMaxTTL(database);
+ } else {
+ databaseTTL = configManager.getTTLManager().getDatabaseLevelTTL(database);
+ if (0 < databaseTTL && databaseTTL < Long.MAX_VALUE) {
+ // For tree mode, the auto cleaner takes effect only when the database-level TTL is set.
+ // Subsequently, we employ the maximum TTL among all time series in this database.
+ databaseTTL = configManager.getTTLManager().getDatabaseMaxTTL(database);
+ }
+ }
databaseTTLMap.put(database, databaseTTL);
}
LOGGER.info(
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/ttl/TTLCache.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/ttl/TTLCache.java
index 9bed883a275..3bc72ed0472 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/ttl/TTLCache.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/ttl/TTLCache.java
@@ -175,6 +175,35 @@ public class TTLCache {
return node.ttl;
}
+ /**
+ * Get the maximum ttl of the corresponding database level.
+ *
+ * @param database the path of the database.
+ * @return the maximum ttl of the corresponding database level.
+ * @throws IllegalPathException if the database path is illegal.
+ */
+ public long getDatabaseLevelTTL(String database) throws IllegalPathException {
+ long curTTL = NULL_TTL;
+ // Get global TTL root.** if exists
+ CacheNode curNode = ttlCacheTree.searchChild(IoTDBConstant.MULTI_LEVEL_PATH_WILDCARD);
+ if (curNode != null && curNode.ttl < Long.MAX_VALUE) {
+ curTTL = curNode.ttl;
+ }
+ // Compare database TTL if exists
+ curNode = ttlCacheTree.searchChild(database);
+ if (curNode != null && curNode.ttl < Long.MAX_VALUE) {
+ curTTL = Math.max(curTTL, curNode.ttl);
+ }
+ // Compare database.** TTL if exists
+ curNode =
+ ttlCacheTree.searchChild(
+ database + IoTDBConstant.PATH_SEPARATOR + IoTDBConstant.MULTI_LEVEL_PATH_WILDCARD);
+ if (curNode != null && curNode.ttl < Long.MAX_VALUE) {
+ curTTL = Math.max(curTTL, curNode.ttl);
+ }
+ return curTTL;
+ }
+
/**
* Get the maximum ttl of the subtree of the corresponding database.
*
(iotdb) 01/07: Change default dn rpc address (#17060)
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch rc/2.0.7
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit ad5fc6d0cc949894a49784c969e453cb90d8d26c
Author: Haonan <hh...@outlook.com>
AuthorDate: Thu Jan 22 14:44:48 2026 +0800
Change default dn rpc address (#17060)
* Change default dn rpc address
* Change default dn rpc address
(cherry picked from commit f198b8e4718357ffa2368bd7ef750902911d4c0b)
---
.../datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java | 2 +-
.../node-commons/src/assembly/resources/conf/iotdb-system.properties | 2 +-
.../src/assembly/resources/conf/iotdb-system.properties.template | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
index 64d0dc6d214..a4d540e663a 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
@@ -125,7 +125,7 @@ public class IoTDBConfig {
private int mqttMaxMessageSize = 1048576;
/** Rpc binding address. */
- private String rpcAddress = "0.0.0.0";
+ private String rpcAddress = "127.0.0.1";
/** whether to use thrift compression. */
private boolean rpcThriftCompressionEnable = false;
diff --git a/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties b/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties
index 3aef3b45355..4015a4b2f3e 100644
--- a/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties
+++ b/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties
@@ -39,7 +39,7 @@ cn_internal_address=127.0.0.1
cn_internal_port=10710
cn_consensus_port=10720
-dn_rpc_address=0.0.0.0
+dn_rpc_address=127.0.0.1
dn_rpc_port=6667
dn_internal_address=127.0.0.1
dn_internal_port=10730
diff --git a/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties.template b/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties.template
index 207c0507093..c8e42c2f0d2 100644
--- a/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties.template
+++ b/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties.template
@@ -73,7 +73,7 @@ cn_consensus_port=10720
# Could set 127.0.0.1(for local test) or ipv4 address
# effectiveMode: restart
# Datatype: String
-dn_rpc_address=0.0.0.0
+dn_rpc_address=127.0.0.1
# Used for connection of IoTDB native clients(Session)
# Bind with dn_rpc_address
(iotdb) 07/07: Pipe: Changed the separator check semantic for pipes / pipe plugins (#17175)
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch rc/2.0.7
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 3ba95a80d465cb65d2feaaa791702da9056a6b4d
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Fri Feb 6 14:48:29 2026 +0800
Pipe: Changed the separator check semantic for pipes / pipe plugins (#17175)
* fix
* sep
(cherry picked from commit d9b692bcca7e974b0aed74507d2af183c31ed8d1)
---
.../iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java | 2 +-
.../src/main/java/org/apache/iotdb/commons/utils/FileUtils.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java
index 4d739a013d3..45b5e7e27ec 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java
@@ -342,7 +342,7 @@ public class IoTDBPipeSyntaxIT extends AbstractPipeDualTreeModelAutoIT {
public void testDirectoryErrors() throws SQLException {
try (final Connection connection = senderEnv.getConnection();
final Statement statement = connection.createStatement()) {
- List<String> wrongDirs = Arrays.asList(".", "..", "./hackYou", ".\\hackYouTwice");
+ List<String> wrongDirs = Arrays.asList(".", "..", "/hackYou", "..\\hackYouTwice");
if (SystemUtils.IS_OS_WINDOWS) {
wrongDirs = new ArrayList<>(wrongDirs);
wrongDirs.add("BombWindows/:*?");
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java
index 2e1d3d16a00..0824e07dd38 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java
@@ -568,7 +568,7 @@ public class FileUtils {
}
public static String getIllegalError4Directory(final String path) {
- if (path.equals(".") || path.equals("..") || path.contains("./") || path.contains(".\\")) {
+ if (path.equals(".") || path.equals("..") || path.contains("/") || path.contains("\\")) {
return ILLEGAL_PATH_MESSAGE;
}
if (!WindowsOSUtils.isLegalPathSegment4Windows(path)) {
(iotdb) 03/07: Remove built-in jexl function in tree mode (#17092)
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch rc/2.0.7
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 618939cf10c26ff33098e804042695da9472666d
Author: Jackie Tien <ja...@gmail.com>
AuthorDate: Wed Jan 28 11:31:33 2026 +0800
Remove built-in jexl function in tree mode (#17092)
(cherry picked from commit b40b74b31ea506127a8d46df9bee26d1868e6228)
---
dependencies.json | 333 +++++++++----------
.../BuiltinTimeSeriesGeneratingFunctionEnum.java | 1 -
.../db/it/udf/IoTDBUDTFBuiltinFunctionIT.java | 235 -------------
iotdb-core/node-commons/pom.xml | 4 -
.../BuiltinTimeSeriesGeneratingFunction.java | 1 -
.../apache/iotdb/commons/udf/builtin/UDTFJexl.java | 365 ---------------------
pom.xml | 6 -
7 files changed, 168 insertions(+), 777 deletions(-)
diff --git a/dependencies.json b/dependencies.json
index c2a255d7ba4..1e88db84e77 100644
--- a/dependencies.json
+++ b/dependencies.json
@@ -1,167 +1,170 @@
{
- "dependencies": [
- "cglib:cglib",
- "ch.qos.logback:logback-classic",
- "ch.qos.logback:logback-core",
- "ch.qos.reload4j:reload4j",
- "com.digitalpetri.fsm:strict-machine",
- "com.digitalpetri.netty:netty-channel-fsm",
- "com.fasterxml.jackson.core:jackson-annotations",
- "com.fasterxml.jackson.core:jackson-core",
- "com.fasterxml.jackson.core:jackson-databind",
- "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml",
- "com.fasterxml.jackson.datatype:jackson-datatype-jsr310",
- "com.fasterxml.jackson.jaxrs:jackson-jaxrs-base",
- "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider",
- "com.fasterxml.jackson.module:jackson-module-jaxb-annotations",
- "com.github.ben-manes.caffeine:caffeine",
- "com.github.luben:zstd-jni",
- "com.github.stephenc.jcip:jcip-annotations",
- "com.github.wendykierp:JTransforms",
- "com.google.code.findbugs:jsr305",
- "com.google.code.gson:gson",
- "com.google.errorprone:error_prone_annotations",
- "com.google.guava:failureaccess",
- "com.google.guava:guava",
- "com.google.guava:listenablefuture",
- "com.google.j2objc:j2objc-annotations",
- "com.h2database:h2-mvstore",
- "com.lmax:disruptor",
- "com.nimbusds:content-type",
- "com.nimbusds:lang-tag",
- "com.nimbusds:nimbus-jose-jwt",
- "com.nimbusds:oauth2-oidc-sdk",
- "com.sun.istack:istack-commons-runtime",
- "com.zaxxer:HikariCP",
- "commons-cli:commons-cli",
- "commons-codec:commons-codec",
- "commons-io:commons-io",
- "commons-logging:commons-logging",
- "io.airlift:airline",
- "io.airlift:concurrent",
- "io.airlift:log",
- "io.airlift:units",
- "io.dropwizard.metrics:metrics-core",
- "io.jsonwebtoken:jjwt-api",
- "io.micrometer:micrometer-commons",
- "io.micrometer:micrometer-core",
- "io.micrometer:micrometer-observation",
- "com.github.moquette-io.moquette:moquette-broker",
- "io.netty:netty-buffer",
- "io.netty:netty-codec",
- "io.netty:netty-codec-dns",
- "io.netty:netty-codec-http",
- "io.netty:netty-codec-http2",
- "io.netty:netty-codec-mqtt",
- "io.netty:netty-codec-socks",
- "io.netty:netty-common",
- "io.netty:netty-handler",
- "io.netty:netty-handler-proxy",
- "io.netty:netty-resolver",
- "io.netty:netty-resolver-dns",
- "io.netty:netty-resolver-dns-classes-macos",
- "io.netty:netty-resolver-dns-native-macos",
- "io.netty:netty-tcnative-boringssl-static",
- "io.netty:netty-tcnative-classes",
- "io.netty:netty-transport",
- "io.netty:netty-transport-classes-epoll",
- "io.netty:netty-transport-native-epoll",
- "io.netty:netty-transport-native-unix-common",
- "io.netty:netty-transport-classes-kqueue",
- "io.netty:netty-transport-native-kqueue",
- "io.projectreactor:reactor-core",
- "io.projectreactor.netty:reactor-netty-core",
- "io.projectreactor.netty:reactor-netty-http",
- "io.swagger:swagger-annotations",
- "io.swagger:swagger-core",
- "io.swagger:swagger-jaxrs",
- "io.swagger:swagger-models",
- "jakarta.activation:jakarta.activation-api",
- "jakarta.annotation:jakarta.annotation-api",
- "jakarta.servlet:jakarta.servlet-api",
- "jakarta.validation:jakarta.validation-api",
- "jakarta.ws.rs:jakarta.ws.rs-api",
- "jakarta.xml.bind:jakarta.xml.bind-api",
- "net.java.dev.jna:jna",
- "net.java.dev.jna:jna-platform",
- "net.minidev:accessors-smart",
- "net.minidev:json-smart",
- "org.antlr:antlr4-runtime",
- "org.apache.commons:commons-collections4",
- "org.apache.commons:commons-csv",
- "org.apache.commons:commons-jexl3",
- "org.apache.commons:commons-lang3",
- "org.apache.commons:commons-math3",
- "org.apache.commons:commons-pool2",
- "org.apache.httpcomponents:httpclient",
- "org.apache.httpcomponents:httpcore",
- "com.timecho.ratis:ratis-client",
- "com.timecho.ratis:ratis-common",
- "com.timecho.ratis:ratis-grpc",
- "com.timecho.ratis:ratis-metrics-api",
- "com.timecho.ratis:ratis-proto",
- "com.timecho.ratis:ratis-server",
- "com.timecho.ratis:ratis-server-api",
- "org.apache.ratis:ratis-thirdparty-misc",
- "org.apache.thrift:libthrift",
- "org.apache.tsfile:common",
- "org.apache.tsfile:tsfile",
- "org.bouncycastle:bcpkix-jdk18on",
- "org.bouncycastle:bcprov-jdk18on",
- "org.bouncycastle:bcutil-jdk18on",
- "org.checkerframework:checker-qual",
- "org.eclipse.collections:eclipse-collections",
- "org.eclipse.collections:eclipse-collections-api",
- "org.eclipse.jetty:jetty-http",
- "org.eclipse.jetty:jetty-io",
- "org.eclipse.jetty:jetty-security",
- "org.eclipse.jetty:jetty-server",
- "org.eclipse.jetty:jetty-servlet",
- "org.eclipse.jetty:jetty-util",
- "org.eclipse.jetty:jetty-util-ajax",
- "org.eclipse.milo:bsd-core",
- "org.eclipse.milo:bsd-generator",
- "org.eclipse.milo:sdk-client",
- "org.eclipse.milo:sdk-core",
- "org.eclipse.milo:sdk-server",
- "org.eclipse.milo:stack-client",
- "org.eclipse.milo:stack-core",
- "org.eclipse.milo:stack-server",
- "org.fusesource.hawtbuf:hawtbuf",
- "org.fusesource.hawtdispatch:hawtdispatch",
- "org.fusesource.hawtdispatch:hawtdispatch-transport",
- "org.fusesource.mqtt-client:mqtt-client",
- "org.glassfish.hk2:hk2-api",
- "org.glassfish.hk2:hk2-locator",
- "org.glassfish.hk2:hk2-utils",
- "org.glassfish.hk2:osgi-resource-locator",
- "org.glassfish.hk2.external:aopalliance-repackaged",
- "org.glassfish.hk2.external:jakarta.inject",
- "org.glassfish.jaxb:jaxb-runtime",
- "org.glassfish.jaxb:txw2",
- "org.glassfish.jersey.containers:jersey-container-servlet-core",
- "org.glassfish.jersey.core:jersey-client",
- "org.glassfish.jersey.core:jersey-common",
- "org.glassfish.jersey.core:jersey-server",
- "org.glassfish.jersey.inject:jersey-hk2",
- "org.glassfish.jersey.media:jersey-media-multipart",
- "org.hdrhistogram:HdrHistogram",
- "org.java-websocket:Java-WebSocket",
- "org.javassist:javassist",
- "org.jline:jline",
- "org.jvnet.mimepull:mimepull",
- "org.latencyutils:LatencyUtils",
- "org.lz4:lz4-java",
- "org.ops4j.pax.jdbc:pax-jdbc-common",
- "org.osgi:osgi.cmpn",
- "org.osgi:osgi.core",
- "org.ow2.asm:asm",
- "org.reactivestreams:reactive-streams",
- "org.slf4j:slf4j-api",
- "org.slf4j:slf4j-reload4j",
- "org.tukaani:xz",
- "org.xerial.snappy:snappy-java",
- "org.yaml:snakeyaml",
- "pl.edu.icm:JLargeArrays"
- ]
+ "dependencies": [
+ "at.yawk.lz4:lz4-java",
+ "cglib:cglib",
+ "ch.qos.logback:logback-classic",
+ "ch.qos.logback:logback-core",
+ "ch.qos.reload4j:reload4j",
+ "com.digitalpetri.fsm:strict-machine",
+ "com.digitalpetri.netty:netty-channel-fsm",
+ "com.fasterxml.jackson.core:jackson-annotations",
+ "com.fasterxml.jackson.core:jackson-core",
+ "com.fasterxml.jackson.core:jackson-databind",
+ "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml",
+ "com.fasterxml.jackson.datatype:jackson-datatype-jsr310",
+ "com.fasterxml.jackson.jaxrs:jackson-jaxrs-base",
+ "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider",
+ "com.fasterxml.jackson.module:jackson-module-jaxb-annotations",
+ "com.github.ben-manes.caffeine:caffeine",
+ "com.github.luben:zstd-jni",
+ "com.github.moquette-io.moquette:moquette-broker",
+ "com.github.stephenc.jcip:jcip-annotations",
+ "com.github.wendykierp:JTransforms",
+ "com.google.code.findbugs:jsr305",
+ "com.google.code.gson:gson",
+ "com.google.errorprone:error_prone_annotations",
+ "com.google.guava:failureaccess",
+ "com.google.guava:guava",
+ "com.google.guava:listenablefuture",
+ "com.google.j2objc:j2objc-annotations",
+ "com.h2database:h2-mvstore",
+ "com.nimbusds:content-type",
+ "com.nimbusds:lang-tag",
+ "com.nimbusds:nimbus-jose-jwt",
+ "com.nimbusds:oauth2-oidc-sdk",
+ "com.sun.istack:istack-commons-runtime",
+ "org.apache.ratis:ratis-client",
+ "org.apache.ratis:ratis-common",
+ "org.apache.ratis:ratis-grpc",
+ "org.apache.ratis:ratis-metrics-api",
+ "org.apache.ratis:ratis-proto",
+ "org.apache.ratis:ratis-server",
+ "org.apache.ratis:ratis-server-api",
+ "com.zaxxer:HikariCP",
+ "commons-cli:commons-cli",
+ "commons-codec:commons-codec",
+ "commons-codec:commons-codec",
+ "commons-logging:commons-logging",
+ "io.airlift:airline",
+ "io.airlift:units",
+ "io.dropwizard.metrics:metrics-core",
+ "io.jsonwebtoken:jjwt-api",
+ "io.micrometer:micrometer-commons",
+ "io.micrometer:micrometer-core",
+ "io.micrometer:micrometer-observation",
+ "io.netty:netty-buffer",
+ "io.netty:netty-codec",
+ "io.netty:netty-codec-dns",
+ "io.netty:netty-codec-http",
+ "io.netty:netty-codec-http2",
+ "io.netty:netty-codec-mqtt",
+ "io.netty:netty-codec-socks",
+ "io.netty:netty-common",
+ "io.netty:netty-handler",
+ "io.netty:netty-handler-proxy",
+ "io.netty:netty-resolver",
+ "io.netty:netty-resolver-dns",
+ "io.netty:netty-resolver-dns-classes-macos",
+ "io.netty:netty-resolver-dns-native-macos",
+ "io.netty:netty-tcnative-boringssl-static",
+ "io.netty:netty-tcnative-boringssl-static",
+ "io.netty:netty-tcnative-boringssl-static",
+ "io.netty:netty-tcnative-boringssl-static",
+ "io.netty:netty-tcnative-boringssl-static",
+ "io.netty:netty-tcnative-classes",
+ "io.netty:netty-transport",
+ "io.netty:netty-transport-classes-epoll",
+ "io.netty:netty-transport-classes-kqueue",
+ "io.netty:netty-transport-native-epoll",
+ "io.netty:netty-transport-native-epoll",
+ "io.netty:netty-transport-native-kqueue",
+ "io.netty:netty-transport-native-kqueue",
+ "io.netty:netty-transport-native-unix-common",
+ "io.projectreactor:reactor-core",
+ "io.projectreactor.netty:reactor-netty-core",
+ "io.projectreactor.netty:reactor-netty-http",
+ "io.swagger:swagger-annotations",
+ "io.swagger:swagger-core",
+ "io.swagger:swagger-jaxrs",
+ "io.swagger:swagger-models",
+ "jakarta.activation:jakarta.activation-api",
+ "jakarta.annotation:jakarta.annotation-api",
+ "jakarta.servlet:jakarta.servlet-api",
+ "jakarta.validation:jakarta.validation-api",
+ "jakarta.ws.rs:jakarta.ws.rs-api",
+ "jakarta.xml.bind:jakarta.xml.bind-api",
+ "net.java.dev.jna:jna",
+ "net.java.dev.jna:jna-platform",
+ "net.minidev:accessors-smart",
+ "net.minidev:json-smart",
+ "org.antlr:antlr4-runtime",
+ "org.apache.commons:commons-csv",
+ "org.apache.commons:commons-lang3",
+ "org.apache.commons:commons-lang3",
+ "org.apache.commons:commons-math3",
+ "org.apache.commons:commons-pool2",
+ "org.apache.httpcomponents:httpclient",
+ "org.apache.httpcomponents:httpcore",
+ "org.apache.ratis:ratis-thirdparty-misc",
+ "org.apache.thrift:libthrift",
+ "org.apache.tsfile:common",
+ "org.apache.tsfile:tsfile",
+ "org.bouncycastle:bcpkix-jdk18on",
+ "org.bouncycastle:bcprov-jdk18on",
+ "org.bouncycastle:bcutil-jdk18on",
+ "org.checkerframework:checker-qual",
+ "org.checkerframework:checker-qual",
+ "org.eclipse.collections:eclipse-collections",
+ "org.eclipse.collections:eclipse-collections-api",
+ "org.eclipse.jetty:jetty-http",
+ "org.eclipse.jetty:jetty-io",
+ "org.eclipse.jetty:jetty-security",
+ "org.eclipse.jetty:jetty-server",
+ "org.eclipse.jetty:jetty-servlet",
+ "org.eclipse.jetty:jetty-util",
+ "org.eclipse.jetty:jetty-util-ajax",
+ "org.eclipse.milo:bsd-core",
+ "org.eclipse.milo:bsd-generator",
+ "org.eclipse.milo:sdk-client",
+ "org.eclipse.milo:sdk-core",
+ "org.eclipse.milo:sdk-server",
+ "org.eclipse.milo:stack-client",
+ "org.eclipse.milo:stack-core",
+ "org.eclipse.milo:stack-server",
+ "org.fusesource.hawtbuf:hawtbuf",
+ "org.fusesource.hawtdispatch:hawtdispatch",
+ "org.fusesource.hawtdispatch:hawtdispatch-transport",
+ "org.fusesource.mqtt-client:mqtt-client",
+ "org.glassfish.hk2:hk2-api",
+ "org.glassfish.hk2:hk2-locator",
+ "org.glassfish.hk2:hk2-utils",
+ "org.glassfish.hk2:osgi-resource-locator",
+ "org.glassfish.hk2.external:aopalliance-repackaged",
+ "org.glassfish.hk2.external:jakarta.inject",
+ "org.glassfish.jaxb:jaxb-runtime",
+ "org.glassfish.jaxb:txw2",
+ "org.glassfish.jersey.containers:jersey-container-servlet-core",
+ "org.glassfish.jersey.core:jersey-client",
+ "org.glassfish.jersey.core:jersey-common",
+ "org.glassfish.jersey.core:jersey-server",
+ "org.glassfish.jersey.inject:jersey-hk2",
+ "org.glassfish.jersey.media:jersey-media-multipart",
+ "org.hdrhistogram:HdrHistogram",
+ "org.java-websocket:Java-WebSocket",
+ "org.javassist:javassist",
+ "org.jline:jline",
+ "org.jvnet.mimepull:mimepull",
+ "org.latencyutils:LatencyUtils",
+ "org.ops4j.pax.jdbc:pax-jdbc-common",
+ "org.osgi:osgi.cmpn",
+ "org.osgi:osgi.core",
+ "org.ow2.asm:asm",
+ "org.reactivestreams:reactive-streams",
+ "org.slf4j:slf4j-api",
+ "org.slf4j:slf4j-reload4j",
+ "org.tukaani:xz",
+ "org.xerial.snappy:snappy-java",
+ "org.yaml:snakeyaml",
+ "pl.edu.icm:JLargeArrays"
+ ]
}
diff --git a/integration-test/src/main/java/org/apache/iotdb/itbase/constant/BuiltinTimeSeriesGeneratingFunctionEnum.java b/integration-test/src/main/java/org/apache/iotdb/itbase/constant/BuiltinTimeSeriesGeneratingFunctionEnum.java
index fa0c5b5b148..e269f1af701 100644
--- a/integration-test/src/main/java/org/apache/iotdb/itbase/constant/BuiltinTimeSeriesGeneratingFunctionEnum.java
+++ b/integration-test/src/main/java/org/apache/iotdb/itbase/constant/BuiltinTimeSeriesGeneratingFunctionEnum.java
@@ -72,7 +72,6 @@ public enum BuiltinTimeSeriesGeneratingFunctionEnum {
EQUAL_SIZE_BUCKET_AGG_SAMPLE("EQUAL_SIZE_BUCKET_AGG_SAMPLE"),
EQUAL_SIZE_BUCKET_M4_SAMPLE("EQUAL_SIZE_BUCKET_M4_SAMPLE"),
EQUAL_SIZE_BUCKET_OUTLIER_SAMPLE("EQUAL_SIZE_BUCKET_OUTLIER_SAMPLE"),
- JEXL("JEXL"),
MASTER_REPAIR("MASTER_REPAIR"),
M4("M4");
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDTFBuiltinFunctionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDTFBuiltinFunctionIT.java
index 61de72829cc..4bec71586cc 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDTFBuiltinFunctionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDTFBuiltinFunctionIT.java
@@ -1490,241 +1490,6 @@ public class IoTDBUDTFBuiltinFunctionIT {
}
}
- @Test
- public void testUDTFJexl() {
- try (Connection connection = EnvFactory.getEnv().getConnection();
- Statement statement = connection.createStatement()) {
- statement.execute("CREATE TIMESERIES root.sg.d7.s1 with datatype=INT32,encoding=PLAIN");
- statement.execute("CREATE TIMESERIES root.sg.d7.s2 with datatype=FLOAT,encoding=PLAIN");
- statement.execute("CREATE TIMESERIES root.sg.d7.s3 with datatype=DOUBLE,encoding=PLAIN");
- statement.execute("CREATE TIMESERIES root.sg.d7.s4 with datatype=TEXT,encoding=PLAIN");
- statement.execute("CREATE TIMESERIES root.sg.d7.s5 with datatype=BOOLEAN,encoding=PLAIN");
- statement.execute("CREATE TIMESERIES root.sg.d7.s6 with datatype=INT64,encoding=PLAIN");
- statement.execute("CREATE TIMESERIES root.sg.d7.s7 with datatype=INT64,encoding=PLAIN");
- statement.execute("CREATE TIMESERIES root.sg.d7.s8 with datatype=FLOAT,encoding=PLAIN");
- statement.execute("CREATE TIMESERIES root.sg.d7.s9 with datatype=TEXT,encoding=PLAIN");
- } catch (SQLException throwable) {
- fail(throwable.getMessage());
- }
- String[] SQL_FOR_SAMPLE_1 = new String[6];
- String[] SQL_FOR_SAMPLE_2 = new String[6];
- String[] SQL_FOR_SAMPLE_3 = new String[6];
- String[] SQL_FOR_SAMPLE_4 = new String[6];
- String[] SQL_FOR_SAMPLE_5 = new String[6];
- String[] SQL_FOR_SAMPLE_6 = new String[6];
- String[] SQL_FOR_SAMPLE_7 = new String[6];
- String[] SQL_FOR_SAMPLE_8 = new String[6];
- String[] SQL_FOR_SAMPLE_9 = new String[6];
- for (int i = 0; i < 5; i++) {
- SQL_FOR_SAMPLE_1[i] =
- String.format(
- Locale.ENGLISH, "insert into root.sg.d7(time, s1) values (%d, %d)", i, i + 1);
- SQL_FOR_SAMPLE_2[i] =
- String.format(
- Locale.ENGLISH, "insert into root.sg.d7(time, s2) values (%d, %f)", i, i + 1.0);
- SQL_FOR_SAMPLE_3[i] =
- String.format(
- Locale.ENGLISH, "insert into root.sg.d7(time, s3) values (%d, %f)", i, i + 1.0);
- SQL_FOR_SAMPLE_4[i] =
- String.format(
- Locale.ENGLISH, "insert into root.sg.d7(time, s4) values (%d, '%s')", i, "string");
- SQL_FOR_SAMPLE_5[i] = String.format("insert into root.sg.d7(time, s5) values (%d, true)", i);
- SQL_FOR_SAMPLE_6[i] =
- String.format(
- Locale.ENGLISH, "insert into root.sg.d7(time, s6) values (%d, %d)", i, i + 8);
- SQL_FOR_SAMPLE_7[i] =
- String.format(
- Locale.ENGLISH, "insert into root.sg.d7(time, s7) values (%d, %d)", i, i + 1);
- SQL_FOR_SAMPLE_8[i] =
- String.format(
- Locale.ENGLISH, "insert into root.sg.d7(time, s8) values (%d, %f)", i, i + 1.0);
- SQL_FOR_SAMPLE_9[i] =
- String.format(
- Locale.ENGLISH, "insert into root.sg.d7(time, s9) values (%d, '%s')", i, "string");
- }
- SQL_FOR_SAMPLE_1[5] =
- String.format(
- Locale.ENGLISH,
- "insert into root.sg.d7(time, s1) values (%d, %d)",
- 10000000000L,
- 5 + 1);
- SQL_FOR_SAMPLE_2[5] =
- String.format(
- Locale.ENGLISH,
- "insert into root.sg.d7(time, s2) values (%d, %f)",
- 10000000000L,
- 5 + 1.0);
- SQL_FOR_SAMPLE_3[5] =
- String.format(
- Locale.ENGLISH,
- "insert into root.sg.d7(time, s3) values (%d, %f)",
- 10000000000L,
- 5 + 1.0);
- SQL_FOR_SAMPLE_4[5] =
- String.format(
- Locale.ENGLISH,
- "insert into root.sg.d7(time, s4) values (%d, '%s')",
- 10000000000L,
- "string");
- SQL_FOR_SAMPLE_5[5] = String.format("insert into root.sg.d7(time, s5) values (%d, true)", 5);
- SQL_FOR_SAMPLE_6[5] =
- String.format(
- Locale.ENGLISH,
- "insert into root.sg.d7(time, s6) values (%d, %d)",
- 10000000000L,
- 5 + 8);
- SQL_FOR_SAMPLE_7[5] =
- String.format(
- Locale.ENGLISH,
- "insert into root.sg.d7(time, s7) values (%d, %d)",
- 10000000000L,
- 5 + 1);
- SQL_FOR_SAMPLE_8[5] =
- String.format(
- Locale.ENGLISH,
- "insert into root.sg.d7(time, s8) values (%d, %f)",
- 10000000000L,
- 5 + 1.0);
- SQL_FOR_SAMPLE_9[5] =
- String.format(
- Locale.ENGLISH,
- "insert into root.sg.d7(time, s9) values (%d, '%s')",
- 10000000000L,
- "string");
- double[] ANSWER1 = new double[] {2, 4, 6, 8, 10, 12};
- double[] ANSWER2 = new double[] {2, 4, 6, 8, 10, 12};
- double[] ANSWER3 = new double[] {4, 7, 10, 13, 16, 19};
- String[] ANSWER4 =
- new String[] {"string2", "string2", "string2", "string2", "string2", "string2"};
- double[] ANSWER7 = new double[] {1, 4, 9, 16, 25, 36};
- String[] ANSWER8 =
- new String[] {"string1", "string4", "string9", "string16", "string25", "string36"};
- double[] ANSWER9 = new double[] {2, 9, 28, 65, 126, 469};
- try (Connection connection = EnvFactory.getEnv().getConnection();
- Statement statement = connection.createStatement()) {
- for (int i = 0; i < 5; i++) {
- statement.execute(SQL_FOR_SAMPLE_1[i]);
- statement.execute(SQL_FOR_SAMPLE_2[i]);
- statement.execute(SQL_FOR_SAMPLE_3[i]);
- statement.execute(SQL_FOR_SAMPLE_4[i]);
- statement.execute(SQL_FOR_SAMPLE_5[i]);
- statement.execute(SQL_FOR_SAMPLE_6[i]);
- statement.execute(SQL_FOR_SAMPLE_7[i]);
- statement.execute(SQL_FOR_SAMPLE_8[i]);
- statement.execute(SQL_FOR_SAMPLE_9[i]);
- }
- } catch (SQLException throwable) {
- fail(throwable.getMessage());
- }
-
- try (Connection connection = EnvFactory.getEnv().getConnection();
- Statement statement = connection.createStatement()) {
- String functionName = "JEXL";
- String expr1 = "x -> {2 * x}";
- String expr2 = "x -> {x + x}";
- String expr3 = "x -> {x * 3 + 1}";
- String expr4 = "x -> {x + 2}";
- String expr5 = "x -> {x == true}";
- String expr6 = "x -> {x == x}";
- String expr7 = "(x, y) -> {x * y}";
- String expr8 = "(x, y, z) -> {x + y * z}";
- String expr9 = "(x, y, z, a) -> {x * y * z + (a ? 1 : -1)}";
- ResultSet resultSet =
- statement.executeQuery(
- String.format(
- "select %s(s1, 'expr'='%s'), "
- + "%s(s2, 'expr'='%s'), "
- + "%s(s3, 'expr'='%s'), "
- + "%s(s4, 'expr'='%s'), "
- + "%s(s5, 'expr'='%s'), "
- + "%s(s6, 'expr'='%s'), "
- + "%s(s7, s8, 'expr'='%s'), "
- + "%s(s4, s7, s1, 'expr'='%s'), "
- + "%s(s1, s7, s8, s5, 'expr'='%s') "
- + "from root.sg.d7",
- functionName,
- expr1,
- functionName,
- expr2,
- functionName,
- expr3,
- functionName,
- expr4,
- functionName,
- expr5,
- functionName,
- expr6,
- functionName,
- expr7,
- functionName,
- expr8,
- functionName,
- expr9));
- int columnCount = resultSet.getMetaData().getColumnCount();
- assertEquals(1 + 9, columnCount);
- for (int i = 0; i < 5; i++) {
- resultSet.next();
- assertEquals(ANSWER1[i], resultSet.getDouble(2), 0.01);
- assertEquals(ANSWER2[i], resultSet.getDouble(3), 0.01);
- assertEquals(ANSWER3[i], resultSet.getDouble(4), 0.01);
- assertEquals(ANSWER4[i], resultSet.getString(5));
- assertTrue(resultSet.getBoolean(6));
- assertTrue(resultSet.getBoolean(7));
- assertEquals(ANSWER7[i], resultSet.getDouble(8), 0.01);
- assertEquals(ANSWER8[i], resultSet.getString(9));
- assertEquals(ANSWER9[i], resultSet.getDouble(10), 0.01);
- }
-
- resultSet =
- statement.executeQuery(
- String.format(
- "select %s(s1, 'expr'='%s'), "
- + "%s(s2, 'expr'='%s'), "
- + "%s(s3, 'expr'='%s'), "
- + "%s(s4, 'expr'='%s'), "
- + "%s(s5, 'expr'='%s'), "
- + "%s(s6, 'expr'='%s'), "
- + "%s(s7, s8, 'expr'='%s'), "
- + "%s(s4, s7, s1, 'expr'='%s'), "
- + "%s(s1, s7, s8, s5, 'expr'='%s') "
- + "from root.sg.d7 align by device",
- functionName,
- expr1,
- functionName,
- expr2,
- functionName,
- expr3,
- functionName,
- expr4,
- functionName,
- expr5,
- functionName,
- expr6,
- functionName,
- expr7,
- functionName,
- expr8,
- functionName,
- expr9));
- columnCount = resultSet.getMetaData().getColumnCount();
- assertEquals(2 + 9, columnCount);
- for (int i = 0; i < 5; i++) {
- resultSet.next();
- assertEquals(ANSWER1[i], resultSet.getDouble(2 + 1), 0.01);
- assertEquals(ANSWER2[i], resultSet.getDouble(3 + 1), 0.01);
- assertEquals(ANSWER3[i], resultSet.getDouble(4 + 1), 0.01);
- assertEquals(ANSWER4[i], resultSet.getString(5 + 1));
- assertTrue(resultSet.getBoolean(6 + 1));
- assertTrue(resultSet.getBoolean(7 + 1));
- assertEquals(ANSWER7[i], resultSet.getDouble(8 + 1), 0.01);
- assertEquals(ANSWER8[i], resultSet.getString(9 + 1));
- assertEquals(ANSWER9[i], resultSet.getDouble(10 + 1), 0.01);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
@Test
public void testStringFunctions() {
String[] createSQLs =
diff --git a/iotdb-core/node-commons/pom.xml b/iotdb-core/node-commons/pom.xml
index 5c5cf963a9c..1a70babcc12 100644
--- a/iotdb-core/node-commons/pom.xml
+++ b/iotdb-core/node-commons/pom.xml
@@ -159,10 +159,6 @@
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-jexl3</artifactId>
- </dependency>
<dependency>
<groupId>com.github.luben</groupId>
<artifactId>zstd-jni</artifactId>
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/udf/builtin/BuiltinTimeSeriesGeneratingFunction.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/udf/builtin/BuiltinTimeSeriesGeneratingFunction.java
index 304fdcb040f..2284c0c96df 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/udf/builtin/BuiltinTimeSeriesGeneratingFunction.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/udf/builtin/BuiltinTimeSeriesGeneratingFunction.java
@@ -91,7 +91,6 @@ public enum BuiltinTimeSeriesGeneratingFunction {
EQUAL_SIZE_BUCKET_M4_SAMPLE("EQUAL_SIZE_BUCKET_M4_SAMPLE", UDTFEqualSizeBucketM4Sample.class),
EQUAL_SIZE_BUCKET_OUTLIER_SAMPLE(
"EQUAL_SIZE_BUCKET_OUTLIER_SAMPLE", UDTFEqualSizeBucketOutlierSample.class),
- JEXL("JEXL", UDTFJexl.class),
MASTER_REPAIR("MASTER_REPAIR", UDTFMasterRepair.class),
M4("M4", UDTFM4.class);
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/udf/builtin/UDTFJexl.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/udf/builtin/UDTFJexl.java
deleted file mode 100644
index d554cfe2572..00000000000
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/udf/builtin/UDTFJexl.java
+++ /dev/null
@@ -1,365 +0,0 @@
-/*
- * 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.commons.udf.builtin;
-
-import org.apache.iotdb.commons.exception.MetadataException;
-import org.apache.iotdb.commons.udf.utils.UDFDataTypeTransformer;
-import org.apache.iotdb.udf.api.UDTF;
-import org.apache.iotdb.udf.api.access.Row;
-import org.apache.iotdb.udf.api.collector.PointCollector;
-import org.apache.iotdb.udf.api.customizer.config.UDTFConfigurations;
-import org.apache.iotdb.udf.api.customizer.parameter.UDFParameterValidator;
-import org.apache.iotdb.udf.api.customizer.parameter.UDFParameters;
-import org.apache.iotdb.udf.api.customizer.strategy.RowByRowAccessStrategy;
-import org.apache.iotdb.udf.api.exception.UDFException;
-import org.apache.iotdb.udf.api.exception.UDFInputSeriesDataTypeNotValidException;
-import org.apache.iotdb.udf.api.exception.UDFOutputSeriesDataTypeNotValidException;
-import org.apache.iotdb.udf.api.type.Type;
-
-import org.apache.commons.jexl3.JexlBuilder;
-import org.apache.commons.jexl3.JexlEngine;
-import org.apache.commons.jexl3.JexlScript;
-import org.apache.tsfile.enums.TSDataType;
-
-import java.io.IOException;
-import java.util.HashMap;
-
-public class UDTFJexl implements UDTF {
-
- private int inputSeriesNumber;
- private TSDataType[] inputDataType;
- private TSDataType outputDataType;
- private JexlScript script;
- private Evaluator evaluator;
-
- @Override
- public void validate(UDFParameterValidator validator) throws UDFException {
- inputSeriesNumber = validator.getParameters().getChildExpressionsSize();
- for (int i = 0; i < inputSeriesNumber; i++) {
- validator.validateInputSeriesDataType(
- i, Type.INT32, Type.INT64, Type.FLOAT, Type.DOUBLE, Type.TEXT, Type.BOOLEAN);
- }
- validator.validateRequiredAttribute("expr");
- }
-
- @Override
- public void beforeStart(UDFParameters parameters, UDTFConfigurations configurations)
- throws UDFInputSeriesDataTypeNotValidException,
- UDFOutputSeriesDataTypeNotValidException,
- MetadataException {
- String expr = parameters.getString("expr");
- JexlEngine jexl = new JexlBuilder().create();
- script = jexl.createScript(expr);
-
- inputDataType = new TSDataType[inputSeriesNumber];
- for (int i = 0; i < inputSeriesNumber; i++) {
- inputDataType[i] = UDFDataTypeTransformer.transformToTsDataType(parameters.getDataType(i));
- }
- outputDataType = probeOutputDataType();
-
- if (inputSeriesNumber == 1) {
- switch (inputDataType[0]) {
- case INT32:
- evaluator = new EvaluatorIntInput();
- break;
- case INT64:
- evaluator = new EvaluatorLongInput();
- break;
- case FLOAT:
- evaluator = new EvaluatorFloatInput();
- break;
- case DOUBLE:
- evaluator = new EvaluatorDoubleInput();
- break;
- case TEXT:
- evaluator = new EvaluatorStringInput();
- break;
- case BOOLEAN:
- evaluator = new EvaluatorBooleanInput();
- break;
- case STRING:
- case TIMESTAMP:
- case DATE:
- case BLOB:
- default:
- throw new UDFInputSeriesDataTypeNotValidException(
- 0,
- UDFDataTypeTransformer.transformToUDFDataType(inputDataType[0]),
- Type.INT32,
- Type.INT64,
- Type.FLOAT,
- Type.DOUBLE,
- Type.TEXT,
- Type.BOOLEAN);
- }
- } else {
- evaluator = new EvaluatorMulInput();
- }
-
- configurations
- .setAccessStrategy(new RowByRowAccessStrategy())
- .setOutputDataType(UDFDataTypeTransformer.transformToUDFDataType(outputDataType));
- }
-
- // 23, 23L, 23f, 23d, "string", true are hard codes for probing
- private HashMap<TSDataType, Object> initialMap() {
- HashMap<TSDataType, Object> map = new HashMap<>();
- map.put(TSDataType.INT32, 23);
- map.put(TSDataType.INT64, 23L);
- map.put(TSDataType.FLOAT, 23f);
- map.put(TSDataType.DOUBLE, 23d);
- map.put(TSDataType.TEXT, "string");
- map.put(TSDataType.BOOLEAN, true);
- return map;
- }
-
- private TSDataType probeOutputDataType() throws UDFOutputSeriesDataTypeNotValidException {
- // initial inputHardCodes to probe OutputDataType
- HashMap<TSDataType, Object> map = initialMap();
- Object[] inputHardCodes = new Object[inputSeriesNumber];
- for (int i = 0; i < inputSeriesNumber; i++) {
- inputHardCodes[i] = map.get(inputDataType[i]);
- }
-
- Object o = script.execute(null, inputHardCodes);
-
- if (o instanceof Number) {
- return TSDataType.DOUBLE;
- } else if (o instanceof String) {
- return TSDataType.TEXT;
- } else if (o instanceof Boolean) {
- return TSDataType.BOOLEAN;
- } else {
- throw new UDFOutputSeriesDataTypeNotValidException(0, "[Number, String, Boolean]");
- }
- }
-
- @Override
- public void transform(Row row, PointCollector collector)
- throws IOException,
- UDFOutputSeriesDataTypeNotValidException,
- UDFInputSeriesDataTypeNotValidException {
- switch (outputDataType) {
- case DOUBLE:
- evaluator.evaluateDouble(row, collector);
- break;
- case TEXT:
- evaluator.evaluateText(row, collector);
- break;
- case BOOLEAN:
- evaluator.evaluateBoolean(row, collector);
- break;
- case TIMESTAMP:
- case DATE:
- case STRING:
- case BLOB:
- case INT64:
- case INT32:
- case FLOAT:
- default:
- // This will not happen.
- throw new UDFOutputSeriesDataTypeNotValidException(0, "[Number, String, Boolean]");
- }
- }
-
- private interface Evaluator {
- void evaluateDouble(Row row, PointCollector collector)
- throws IOException, UDFInputSeriesDataTypeNotValidException;
-
- void evaluateText(Row row, PointCollector collector)
- throws IOException, UDFInputSeriesDataTypeNotValidException;
-
- void evaluateBoolean(Row row, PointCollector collector)
- throws IOException, UDFInputSeriesDataTypeNotValidException;
- }
-
- private class EvaluatorIntInput implements Evaluator {
- @Override
- public void evaluateDouble(Row row, PointCollector collector) throws IOException {
- collector.putDouble(
- row.getTime(), ((Number) script.execute(null, row.getInt(0))).doubleValue());
- }
-
- @Override
- public void evaluateText(Row row, PointCollector collector) throws IOException {
- collector.putString(row.getTime(), (String) script.execute(null, row.getInt(0)));
- }
-
- @Override
- public void evaluateBoolean(Row row, PointCollector collector) throws IOException {
- collector.putBoolean(row.getTime(), (Boolean) script.execute(null, row.getInt(0)));
- }
- }
-
- private class EvaluatorLongInput implements Evaluator {
- @Override
- public void evaluateDouble(Row row, PointCollector collector) throws IOException {
- collector.putDouble(
- row.getTime(), ((Number) script.execute(null, row.getLong(0))).doubleValue());
- }
-
- @Override
- public void evaluateText(Row row, PointCollector collector) throws IOException {
- collector.putString(row.getTime(), (String) script.execute(null, row.getLong(0)));
- }
-
- @Override
- public void evaluateBoolean(Row row, PointCollector collector) throws IOException {
- collector.putBoolean(row.getTime(), (Boolean) script.execute(null, row.getLong(0)));
- }
- }
-
- private class EvaluatorFloatInput implements Evaluator {
- @Override
- public void evaluateDouble(Row row, PointCollector collector) throws IOException {
- collector.putDouble(
- row.getTime(), ((Number) script.execute(null, row.getFloat(0))).doubleValue());
- }
-
- @Override
- public void evaluateText(Row row, PointCollector collector) throws IOException {
- collector.putString(row.getTime(), (String) script.execute(null, row.getFloat(0)));
- }
-
- @Override
- public void evaluateBoolean(Row row, PointCollector collector) throws IOException {
- collector.putBoolean(row.getTime(), (Boolean) script.execute(null, row.getFloat(0)));
- }
- }
-
- private class EvaluatorDoubleInput implements Evaluator {
- @Override
- public void evaluateDouble(Row row, PointCollector collector) throws IOException {
- collector.putDouble(
- row.getTime(), ((Number) script.execute(null, row.getDouble(0))).doubleValue());
- }
-
- @Override
- public void evaluateText(Row row, PointCollector collector) throws IOException {
- collector.putString(row.getTime(), (String) script.execute(null, row.getDouble(0)));
- }
-
- @Override
- public void evaluateBoolean(Row row, PointCollector collector) throws IOException {
- collector.putBoolean(row.getTime(), (Boolean) script.execute(null, row.getDouble(0)));
- }
- }
-
- private class EvaluatorStringInput implements Evaluator {
- @Override
- public void evaluateDouble(Row row, PointCollector collector) throws IOException {
- collector.putDouble(
- row.getTime(), ((Number) script.execute(null, row.getString(0))).doubleValue());
- }
-
- @Override
- public void evaluateText(Row row, PointCollector collector) throws IOException {
- collector.putString(row.getTime(), (String) script.execute(null, row.getString(0)));
- }
-
- @Override
- public void evaluateBoolean(Row row, PointCollector collector) throws IOException {
- collector.putBoolean(row.getTime(), (Boolean) script.execute(null, row.getString(0)));
- }
- }
-
- private class EvaluatorBooleanInput implements Evaluator {
- @Override
- public void evaluateDouble(Row row, PointCollector collector) throws IOException {
- collector.putDouble(
- row.getTime(), ((Number) script.execute(null, row.getBoolean(0))).doubleValue());
- }
-
- @Override
- public void evaluateText(Row row, PointCollector collector) throws IOException {
- collector.putString(row.getTime(), (String) script.execute(null, row.getBoolean(0)));
- }
-
- @Override
- public void evaluateBoolean(Row row, PointCollector collector) throws IOException {
- collector.putBoolean(row.getTime(), (Boolean) script.execute(null, row.getBoolean(0)));
- }
- }
-
- private class EvaluatorMulInput implements Evaluator {
-
- Object[] values = new Object[inputSeriesNumber];
-
- @Override
- public void evaluateDouble(Row row, PointCollector collector)
- throws IOException, UDFInputSeriesDataTypeNotValidException {
- getValues(row);
- collector.putDouble(row.getTime(), ((Number) script.execute(null, values)).doubleValue());
- }
-
- @Override
- public void evaluateText(Row row, PointCollector collector)
- throws IOException, UDFInputSeriesDataTypeNotValidException {
- getValues(row);
- collector.putString(row.getTime(), (String) script.execute(null, values));
- }
-
- @Override
- public void evaluateBoolean(Row row, PointCollector collector)
- throws IOException, UDFInputSeriesDataTypeNotValidException {
- getValues(row);
- collector.putBoolean(row.getTime(), (Boolean) script.execute(null, values));
- }
-
- public void getValues(Row row) throws IOException, UDFInputSeriesDataTypeNotValidException {
- for (int i = 0; i < inputSeriesNumber; i++) {
- switch (inputDataType[i]) {
- case INT32:
- values[i] = row.getInt(i);
- break;
- case INT64:
- values[i] = row.getLong(i);
- break;
- case FLOAT:
- values[i] = row.getFloat(i);
- break;
- case DOUBLE:
- values[i] = row.getDouble(i);
- break;
- case TEXT:
- values[i] = row.getString(i);
- break;
- case BOOLEAN:
- values[i] = row.getBoolean(i);
- break;
- case STRING:
- case BLOB:
- case DATE:
- case TIMESTAMP:
- default:
- throw new UDFInputSeriesDataTypeNotValidException(
- i,
- UDFDataTypeTransformer.transformToUDFDataType(inputDataType[i]),
- Type.INT32,
- Type.INT64,
- Type.FLOAT,
- Type.DOUBLE,
- Type.TEXT,
- Type.BOOLEAN);
- }
- }
- }
- }
-}
diff --git a/pom.xml b/pom.xml
index 1c01f72b1a3..baba6fcdd46 100644
--- a/pom.xml
+++ b/pom.xml
@@ -70,7 +70,6 @@
<commons-codec.version>1.16.1</commons-codec.version>
<commons-csv.version>1.10.0</commons-csv.version>
<commons-io.version>2.14.0</commons-io.version>
- <commons-jexl3.version>3.3</commons-jexl3.version>
<commons-lang3.version>3.18.0</commons-lang3.version>
<commons-math3.version>3.6.1</commons-math3.version>
<commons-pool2.version>2.11.1</commons-pool2.version>
@@ -515,11 +514,6 @@
<artifactId>cglib</artifactId>
<version>${cglib.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-jexl3</artifactId>
- <version>${commons-jexl3.version}</version>
- </dependency>
<dependency>
<groupId>com.github.luben</groupId>
<artifactId>zstd-jni</artifactId>
(iotdb) 05/07: Pipe: Banned the illegal names in pipe and pipe plugins (#17145)
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch rc/2.0.7
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 5d33826dc4375f13b391466ce9753964618afdd3
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Wed Feb 4 09:38:44 2026 +0800
Pipe: Banned the illegal names in pipe and pipe plugins (#17145)
* fix
* fix
* fix
* sp-linux
(cherry picked from commit 52d7245a2b849c80bb424bb8fc6b67ad3ced2311)
---
.../treemodel/auto/basic/IoTDBPipeSyntaxIT.java | 64 ++++++++++++++++++++++
.../legacy/IoTDBLegacyPipeReceiverAgent.java | 5 +-
.../config/executor/ClusterConfigTaskExecutor.java | 34 +++++++++---
.../org/apache/iotdb/commons/utils/FileUtils.java | 12 ++++
4 files changed, 107 insertions(+), 8 deletions(-)
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java
index e925e9e4428..74c5598d616 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java
@@ -31,6 +31,7 @@ import org.apache.iotdb.itbase.category.MultiClusterIT2DualTreeAutoBasic;
import org.apache.iotdb.pipe.it.dual.treemodel.auto.AbstractPipeDualTreeModelAutoIT;
import org.apache.iotdb.rpc.TSStatusCode;
+import org.apache.tsfile.external.commons.lang3.SystemUtils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -40,6 +41,7 @@ import org.junit.runner.RunWith;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@@ -335,6 +337,68 @@ public class IoTDBPipeSyntaxIT extends AbstractPipeDualTreeModelAutoIT {
}
}
+ @Test
+ public void testDirectoryErrors() throws SQLException {
+ try (final Connection connection = senderEnv.getConnection();
+ final Statement statement = connection.createStatement()) {
+ List<String> wrongDirs = Arrays.asList(".", "..", "./hackYou", ".\\hackYouTwice");
+ if (SystemUtils.IS_OS_WINDOWS) {
+ wrongDirs = new ArrayList<>(wrongDirs);
+ wrongDirs.add("BombWindows/:*?");
+ wrongDirs.add("AUX");
+ }
+ for (final String name : wrongDirs) {
+ testDirectoryError(name, statement);
+ }
+ }
+ }
+
+ private void testDirectoryError(final String wrongDir, final Statement statement) {
+ final DataNodeWrapper receiverDataNode = receiverEnv.getDataNodeWrapper(0);
+
+ final String receiverIp = receiverDataNode.getIp();
+ final int receiverPort = receiverDataNode.getPort();
+
+ try {
+ statement.execute(
+ String.format(
+ "create pipe `"
+ + wrongDir
+ + "` with source ()"
+ + " with processor ()"
+ + " with sink ("
+ + "'sink'='invalid-param',"
+ + "'sink.ip'='%s',"
+ + "'sink.port'='%s',"
+ + "'sink.batch.enable'='false')",
+ receiverIp,
+ receiverPort));
+ fail();
+ } catch (final Exception ignore) {
+ // Expected
+ }
+
+ try {
+ statement.execute(
+ String.format(
+ "create pipePlugin `"
+ + wrongDir
+ + "` as 'org.apache.iotdb.db.pipe.example.TestProcessor' USING URI '%s'",
+ new File(
+ System.getProperty("user.dir")
+ + File.separator
+ + "target"
+ + File.separator
+ + "test-classes"
+ + File.separator)
+ .toURI()
+ + "PipePlugin.jar"));
+ fail();
+ } catch (final SQLException e) {
+ Assert.assertTrue(e.getMessage().contains("1600: Failed to create pipe plugin"));
+ }
+ }
+
@Test
public void testBrackets() throws Exception {
final DataNodeWrapper receiverDataNode = receiverEnv.getDataNodeWrapper(0);
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/legacy/IoTDBLegacyPipeReceiverAgent.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/legacy/IoTDBLegacyPipeReceiverAgent.java
index 759a65cffa7..6ce802c3143 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/legacy/IoTDBLegacyPipeReceiverAgent.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/legacy/IoTDBLegacyPipeReceiverAgent.java
@@ -25,6 +25,7 @@ import org.apache.iotdb.commons.audit.UserEntity;
import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.commons.exception.IllegalPathException;
import org.apache.iotdb.commons.path.PartialPath;
+import org.apache.iotdb.commons.utils.FileUtils;
import org.apache.iotdb.db.auth.AuthorityChecker;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.pipe.sink.payload.legacy.PipeData;
@@ -53,6 +54,7 @@ import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.time.ZoneId;
import java.util.Map;
+import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;
@@ -125,7 +127,8 @@ public class IoTDBLegacyPipeReceiverAgent {
}
private boolean validatePipeName(final TSyncIdentityInfo info) {
- return info.isSetPipeName() && !info.getPipeName().contains(File.separator);
+ return info.isSetPipeName()
+ && Objects.isNull(FileUtils.getIllegalError4Directory(info.getPipeName()));
}
private void createConnection(final SyncIdentityInfo identityInfo) {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
index ca02ee1ec13..ef2ee19dc37 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
@@ -74,6 +74,7 @@ import org.apache.iotdb.commons.trigger.service.TriggerExecutableManager;
import org.apache.iotdb.commons.udf.service.UDFClassLoader;
import org.apache.iotdb.commons.udf.service.UDFExecutableManager;
import org.apache.iotdb.commons.utils.CommonDateTimeUtils;
+import org.apache.iotdb.commons.utils.FileUtils;
import org.apache.iotdb.commons.utils.PathUtils;
import org.apache.iotdb.commons.utils.TimePartitionUtils;
import org.apache.iotdb.confignode.rpc.thrift.TAINodeRemoveReq;
@@ -944,6 +945,15 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
final String className = createPipePluginStatement.getClassName();
final String uriString = createPipePluginStatement.getUriString();
+ final String pathError = FileUtils.getIllegalError4Directory(pluginName);
+ if (Objects.nonNull(pathError)) {
+ future.setException(
+ new IoTDBException(
+ String.format("Failed to create pipe plugin %s. " + pathError, pluginName),
+ TSStatusCode.CREATE_PIPE_PLUGIN_ERROR.getStatusCode()));
+ return future;
+ }
+
if (uriString == null || uriString.isEmpty()) {
future.setException(
new IoTDBException(
@@ -2065,6 +2075,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
final SettableFuture<ConfigTaskResult> future = SettableFuture.create();
// Verify that Pipe is disabled if TSFile encryption is enabled
+ final String pipeName = createPipeStatement.getPipeName();
if (!Objects.equals(TSFileDescriptor.getInstance().getConfig().getEncryptType(), "UNENCRYPTED")
&& !Objects.equals(
TSFileDescriptor.getInstance().getConfig().getEncryptType(),
@@ -2073,18 +2084,27 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
new IoTDBException(
String.format(
"Failed to create Pipe %s because TSFile is configured with encryption, which prohibits the use of Pipe",
- createPipeStatement.getPipeName()),
+ pipeName),
TSStatusCode.PIPE_ERROR.getStatusCode()));
return future;
}
// Validate pipe name
- if (createPipeStatement.getPipeName().startsWith(PipeStaticMeta.SYSTEM_PIPE_PREFIX)) {
+ if (pipeName.startsWith(PipeStaticMeta.SYSTEM_PIPE_PREFIX)) {
future.setException(
new IoTDBException(
String.format(
"Failed to create pipe %s, pipe name starting with \"%s\" are not allowed to be created.",
- createPipeStatement.getPipeName(), PipeStaticMeta.SYSTEM_PIPE_PREFIX),
+ pipeName, PipeStaticMeta.SYSTEM_PIPE_PREFIX),
+ TSStatusCode.PIPE_ERROR.getStatusCode()));
+ return future;
+ }
+
+ final String pathError = FileUtils.getIllegalError4Directory(pipeName);
+ if (Objects.nonNull(pathError)) {
+ future.setException(
+ new IoTDBException(
+ String.format("Failed to create pipe %s, " + pathError, pipeName),
TSStatusCode.PIPE_ERROR.getStatusCode()));
return future;
}
@@ -2093,7 +2113,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
try {
PipeDataNodeAgent.plugin()
.validate(
- createPipeStatement.getPipeName(),
+ pipeName,
createPipeStatement.getExtractorAttributes(),
createPipeStatement.getProcessorAttributes(),
createPipeStatement.getConnectorAttributes());
@@ -2115,7 +2135,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
final TCreatePipeReq realtimeReq =
new TCreatePipeReq()
// Append suffix to the pipeline name for real-time data
- .setPipeName(createPipeStatement.getPipeName() + "_realtime")
+ .setPipeName(pipeName + "_realtime")
// NOTE: set if not exists always to true to handle partial failure
.setIfNotExistsCondition(true)
// Use extractor parameters for real-time data
@@ -2143,7 +2163,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
final TCreatePipeReq historyReq =
new TCreatePipeReq()
// Append suffix to the pipeline name for historical data
- .setPipeName(createPipeStatement.getPipeName() + "_history")
+ .setPipeName(pipeName + "_history")
.setIfNotExistsCondition(createPipeStatement.hasIfNotExistsCondition())
// Use source parameters for historical data
.setExtractorAttributes(
@@ -2186,7 +2206,7 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.CONFIG_REGION_ID)) {
final TCreatePipeReq req =
new TCreatePipeReq()
- .setPipeName(createPipeStatement.getPipeName())
+ .setPipeName(pipeName)
.setIfNotExistsCondition(createPipeStatement.hasIfNotExistsCondition())
.setExtractorAttributes(createPipeStatement.getExtractorAttributes())
.setProcessorAttributes(createPipeStatement.getProcessorAttributes())
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java
index a0eb45f0bd6..2e1d3d16a00 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java
@@ -57,6 +57,8 @@ public class FileUtils {
"Renamed file {} to {} because it already exists in the target directory: {}";
private static final String COPY_FILE_MESSAGE =
"Copy file {} to {} because it already exists in the target directory: {}";
+ private static final String ILLEGAL_PATH_MESSAGE =
+ "The path cannot be '.', '..', './' or '.\\'. ";
private FileUtils() {}
@@ -564,4 +566,14 @@ public class FileUtils {
targetFile,
targetFile.getParentFile().getAbsolutePath());
}
+
+ public static String getIllegalError4Directory(final String path) {
+ if (path.equals(".") || path.equals("..") || path.contains("./") || path.contains(".\\")) {
+ return ILLEGAL_PATH_MESSAGE;
+ }
+ if (!WindowsOSUtils.isLegalPathSegment4Windows(path)) {
+ return WindowsOSUtils.OS_SEGMENT_ERROR;
+ }
+ return null;
+ }
}
(iotdb) 02/07: chore!: Bind real config address for Thrift and Raft services (#16717)
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch rc/2.0.7
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 30a3879b7b67ff6b354f8c78c8bb4b90573e8f58
Author: CritasWang <cr...@outlook.com>
AuthorDate: Tue Nov 11 10:44:50 2025 +0800
chore!: Bind real config address for Thrift and Raft services (#16717)
* chore: Bind real internal address for Thrift and Raft services
* keep ExternalRpcAddress use config value
* Update iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/ExternalRPCService.java
Co-authored-by: Haonan <hh...@outlook.com>
---------
Co-authored-by: Haonan <hh...@outlook.com>
(cherry picked from commit 8dbf2003cfde4c2f68fa5fd4e3110c5e7aa334b5)
---
.../org/apache/iotdb/consensus/ratis/RatisConsensus.java | 1 +
.../commons/service/AbstractThriftServiceThread.java | 15 +++++++++++----
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java
index 045fa779174..265192858bf 100644
--- a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java
+++ b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java
@@ -157,6 +157,7 @@ class RatisConsensus implements IConsensus {
this.storageDir = new File(config.getStorageDir());
RaftServerConfigKeys.setStorageDir(properties, Collections.singletonList(storageDir));
+ GrpcConfigKeys.Server.setHost(properties, config.getThisNodeEndPoint().getIp());
GrpcConfigKeys.Server.setPort(properties, config.getThisNodeEndPoint().getPort());
this.parameters = Utils.initRatisConfig(properties, config.getRatisConfig());
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/service/AbstractThriftServiceThread.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/service/AbstractThriftServiceThread.java
index 39b11ba677a..1bcf15dbc23 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/service/AbstractThriftServiceThread.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/service/AbstractThriftServiceThread.java
@@ -320,14 +320,21 @@ public abstract class AbstractThriftServiceThread extends Thread {
@SuppressWarnings("java:S2259")
private TServerTransport openTransport(String bindAddress, int port) throws TTransportException {
- // bind any address
- return new TServerSocket(new InetSocketAddress(port));
+ if (bindAddress == null) {
+ // bind any address
+ return new TServerSocket(new InetSocketAddress(port));
+ }
+ return new TServerSocket(new InetSocketAddress(bindAddress, port));
}
private TServerTransport openNonblockingTransport(
String bindAddress, int port, int connectionTimeoutInMS) throws TTransportException {
- // bind any address
- return new TNonblockingServerSocket(new InetSocketAddress(port), connectionTimeoutInMS);
+ if (bindAddress == null) {
+ // bind any address
+ return new TNonblockingServerSocket(new InetSocketAddress(port), connectionTimeoutInMS);
+ }
+ return new TNonblockingServerSocket(
+ new InetSocketAddress(bindAddress, port), connectionTimeoutInMS);
}
public void setThreadStopLatch(CountDownLatch threadStopLatch) {
(iotdb) 06/07: Fixed the NPE when validating legacy sink (#17153)
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch rc/2.0.7
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 8fe6f510c91c33f905e9e771e963eb6678562639
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Wed Feb 4 14:14:58 2026 +0800
Fixed the NPE when validating legacy sink (#17153)
* npe-fix
* unb
(cherry picked from commit c1f4682c207dd9e45fe363d46ccae927f76fee9d)
---
.../treemodel/auto/basic/IoTDBPipeDataSinkIT.java | 32 ++++-------
.../treemodel/auto/basic/IoTDBPipeSyntaxIT.java | 3 +-
.../sink/protocol/legacy/IoTDBLegacyPipeSink.java | 11 ++--
.../apache/iotdb/commons/utils/WindowsOSUtils.java | 64 ++++++++++++++++++++++
4 files changed, 83 insertions(+), 27 deletions(-)
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeDataSinkIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeDataSinkIT.java
index d828a5054e3..e4363d7964d 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeDataSinkIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeDataSinkIT.java
@@ -35,6 +35,8 @@ import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
+import java.sql.Connection;
+import java.sql.Statement;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
@@ -209,30 +211,16 @@ public class IoTDBPipeDataSinkIT extends AbstractPipeDualTreeModelAutoIT {
final String receiverIp = receiverDataNode.getIp();
final int receiverPort = receiverDataNode.getPort();
+ try (final Connection connection = senderEnv.getConnection();
+ final Statement statement = connection.createStatement()) {
+ statement.execute(
+ String.format(
+ "create pipe testPipe ('sink'='iotdb-legacy-pipe-sink', 'ip'='%s', 'port'='%s', 'version'='1.3')",
+ receiverIp, receiverPort));
+ }
+
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
- final Map<String, String> extractorAttributes = new HashMap<>();
- final Map<String, String> processorAttributes = new HashMap<>();
- final Map<String, String> connectorAttributes = new HashMap<>();
-
- extractorAttributes.put("source.realtime.mode", "log");
-
- connectorAttributes.put("sink", "iotdb-legacy-pipe-sink");
- connectorAttributes.put("sink.batch.enable", "false");
- connectorAttributes.put("sink.ip", receiverIp);
- connectorAttributes.put("sink.port", Integer.toString(receiverPort));
-
- // This version does not matter since it's no longer checked by the legacy receiver
- connectorAttributes.put("sink.version", "1.3");
-
- final TSStatus status =
- client.createPipe(
- new TCreatePipeReq("testPipe", connectorAttributes)
- .setExtractorAttributes(extractorAttributes)
- .setProcessorAttributes(processorAttributes));
-
- Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
-
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("testPipe").getCode());
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java
index 74c5598d616..4d739a013d3 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java
@@ -31,13 +31,14 @@ import org.apache.iotdb.itbase.category.MultiClusterIT2DualTreeAutoBasic;
import org.apache.iotdb.pipe.it.dual.treemodel.auto.AbstractPipeDualTreeModelAutoIT;
import org.apache.iotdb.rpc.TSStatusCode;
-import org.apache.tsfile.external.commons.lang3.SystemUtils;
+import org.apache.commons.lang3.SystemUtils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
+import java.io.File;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/legacy/IoTDBLegacyPipeSink.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/legacy/IoTDBLegacyPipeSink.java
index b3792bc9320..5030738cc82 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/legacy/IoTDBLegacyPipeSink.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/legacy/IoTDBLegacyPipeSink.java
@@ -37,6 +37,7 @@ import org.apache.iotdb.db.pipe.event.common.terminate.PipeTerminateEvent;
import org.apache.iotdb.db.pipe.event.common.tsfile.PipeTsFileInsertionEvent;
import org.apache.iotdb.db.pipe.sink.payload.legacy.TsFilePipeData;
import org.apache.iotdb.db.storageengine.StorageEngine;
+import org.apache.iotdb.db.storageengine.dataregion.DataRegion;
import org.apache.iotdb.pipe.api.PipeConnector;
import org.apache.iotdb.pipe.api.annotation.TreeModel;
import org.apache.iotdb.pipe.api.customizer.configuration.PipeConnectorRuntimeConfiguration;
@@ -109,7 +110,7 @@ public class IoTDBLegacyPipeSink implements PipeConnector {
private String syncConnectorVersion;
private String pipeName;
- private String databaseName;
+ private String databaseName = "";
private IoTDBSyncClient client;
@@ -202,10 +203,12 @@ public class IoTDBLegacyPipeSink implements PipeConnector {
trustStore = parameters.getString(SINK_IOTDB_SSL_TRUST_STORE_PATH_KEY);
trustStorePwd = parameters.getString(SINK_IOTDB_SSL_TRUST_STORE_PWD_KEY);
- databaseName =
+ final DataRegion dataRegion =
StorageEngine.getInstance()
- .getDataRegion(new DataRegionId(configuration.getRuntimeEnvironment().getRegionId()))
- .getDatabaseName();
+ .getDataRegion(new DataRegionId(configuration.getRuntimeEnvironment().getRegionId()));
+ if (Objects.nonNull(dataRegion)) {
+ databaseName = dataRegion.getDatabaseName();
+ }
}
@Override
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/WindowsOSUtils.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/WindowsOSUtils.java
new file mode 100644
index 00000000000..3019c47cf0e
--- /dev/null
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/WindowsOSUtils.java
@@ -0,0 +1,64 @@
+/*
+ * 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.commons.utils;
+
+import org.apache.commons.lang3.SystemUtils;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+public class WindowsOSUtils {
+ private static final String ILLEGAL_WINDOWS_CHARS = "\\/:*?\"<>|";
+ private static final Set<String> ILLEGAL_WINDOWS_NAMES =
+ new HashSet<>(Arrays.asList("CON", "PRN", "AUX", "NUL", "COM1-COM9, LPT1-LPT9"));
+
+ static {
+ for (int i = 0; i < 10; ++i) {
+ ILLEGAL_WINDOWS_NAMES.add("COM" + i);
+ ILLEGAL_WINDOWS_NAMES.add("LPT" + i);
+ }
+ }
+
+ public static final String OS_SEGMENT_ERROR =
+ String.format(
+ "In Windows System, the path shall not contains %s, equals one of %s, or ends with '.' or ' '.",
+ ILLEGAL_WINDOWS_CHARS, ILLEGAL_WINDOWS_NAMES);
+
+ public static boolean isLegalPathSegment4Windows(final String pathSegment) {
+ if (!SystemUtils.IS_OS_WINDOWS) {
+ return true;
+ }
+ for (final char illegalChar : ILLEGAL_WINDOWS_CHARS.toCharArray()) {
+ if (pathSegment.indexOf(illegalChar) != -1) {
+ return false;
+ }
+ }
+ if (pathSegment.endsWith(".") || pathSegment.endsWith(" ")) {
+ return false;
+ }
+ for (final String illegalName : ILLEGAL_WINDOWS_NAMES) {
+ if (pathSegment.equalsIgnoreCase(illegalName)) {
+ return false;
+ }
+ }
+ return true;
+ }
+}