This is an automated email from the ASF dual-hosted git repository.
justinchen pushed a commit to branch plugin-UL
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/plugin-UL by this push:
new e6cecc306a5 fix
e6cecc306a5 is described below
commit e6cecc306a552b13e37e9eabf9757b2a24d45a75
Author: Caideyipi <[email protected]>
AuthorDate: Wed Dec 3 10:38:45 2025 +0800
fix
---
.../treemodel/auto/basic/IoTDBPipeSyntaxIT.java | 61 ++++++++++++++++++++++
.../config/executor/ClusterConfigTaskExecutor.java | 12 +++--
2 files changed, 69 insertions(+), 4 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..4bc59cb717e 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
@@ -37,6 +37,7 @@ 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;
@@ -757,4 +758,64 @@ public class IoTDBPipeSyntaxIT extends
AbstractPipeDualTreeModelAutoIT {
fail(e.getMessage());
}
}
+
+ @Test
+ public void testPipePluginValidation() {
+ try (final Connection connection = senderEnv.getConnection();
+ final Statement statement = connection.createStatement()) {
+ try {
+ statement.execute(
+ "create pipePlugin TestProcessor as
'org.apache.iotdb.db.pipe.example.TestProcessor' USING URI 'xxx'");
+ fail();
+ } catch (final SQLException e) {
+ Assert.assertEquals(
+ "701: Untrusted uri xxx, current trusted_uri_pattern is file:.*",
e.getMessage());
+ }
+ try {
+ statement.execute(
+ "create pipePlugin TestProcessor as
'org.apache.iotdb.db.pipe.example.TestProcessor' USING URI 'file:.*'");
+ fail();
+ } catch (final SQLException e) {
+ Assert.assertEquals("701: URI is not hierarchical", e.getMessage());
+ }
+ try {
+ statement.execute(
+ String.format(
+ "create pipePlugin TestProcessor 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.assertEquals(
+ "1603: Failed to get executable for PipePlugin DO-NOTHING-SINK,
please check the URI.",
+ e.getMessage());
+ }
+ try {
+ statement.execute("drop pipePlugin test_processor");
+ fail();
+ } catch (final SQLException e) {
+ Assert.assertEquals(
+ "1601: Failed to drop pipe plugin TEST_PROCESSOR. Failures:
TEST_PROCESSOR does not exist.",
+ e.getMessage());
+ }
+ try {
+ statement.execute("drop pipePlugin `Do-Nothing-Sink`");
+ fail();
+ } catch (final SQLException e) {
+ Assert.assertEquals(
+ "1601: Failed to drop PipePlugin [DO-NOTHING-SINK], the PipePlugin
is a built-in PipePlugin",
+ e.getMessage());
+ }
+ } catch (final SQLException e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ }
+ }
}
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 fbda4390909..d0f7c7f99d7 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
@@ -994,7 +994,11 @@ public class ClusterConfigTaskExecutor implements
IConfigTaskExecutor {
// Set md5 of the jar file
jarMd5 =
DigestUtils.md5Hex(Files.newInputStream(Paths.get(libRoot)));
}
- } catch (final IOException | URISyntaxException e) {
+ } catch (final URISyntaxException | IllegalArgumentException e) {
+ future.setException(
+ new IoTDBException(e.getMessage(),
TSStatusCode.SEMANTIC_ERROR.getStatusCode()));
+ return future;
+ } catch (final IOException e) {
LOGGER.warn(
"Failed to get executable for PipePlugin({}) using URI: {}.",
createPipePluginStatement.getPluginName(),
@@ -1002,9 +1006,9 @@ public class ClusterConfigTaskExecutor implements
IConfigTaskExecutor {
e);
future.setException(
new IoTDBException(
- "Failed to get executable for PipePlugin"
+ "Failed to get executable for PipePlugin "
+ createPipePluginStatement.getPluginName()
- + "', please check the URI.",
+ + ", please check the URI.",
TSStatusCode.PIPE_PLUGIN_DOWNLOAD_ERROR.getStatusCode()));
return future;
}
@@ -1093,7 +1097,7 @@ public class ClusterConfigTaskExecutor implements
IConfigTaskExecutor {
final TSStatus executionStatus =
client.dropPipePlugin(
new TDropPipePluginReq()
- .setPluginName(dropPipePluginStatement.getPluginName())
+
.setPluginName(dropPipePluginStatement.getPluginName().toUpperCase())
.setIfExistsCondition(dropPipePluginStatement.hasIfExistsCondition())
.setIsTableModel(dropPipePluginStatement.isTableModel()));
if (TSStatusCode.SUCCESS_STATUS.getStatusCode() !=
executionStatus.getCode()) {