This is an automated email from the ASF dual-hosted git repository. justinchen pushed a commit to branch cp-opc-client in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit c0c8919c7f9f9e97921c8973ac63e9ac4b14cbaf Author: Caideyipi <[email protected]> AuthorDate: Thu Mar 26 17:06:16 2026 +0800 fix --- .../api/customizer/parameter/PipeParameters.java | 32 ++++++++++++++-------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/iotdb-api/pipe-api/src/main/java/org/apache/iotdb/pipe/api/customizer/parameter/PipeParameters.java b/iotdb-api/pipe-api/src/main/java/org/apache/iotdb/pipe/api/customizer/parameter/PipeParameters.java index a06630cb2a9..b6d59c827f0 100644 --- a/iotdb-api/pipe-api/src/main/java/org/apache/iotdb/pipe/api/customizer/parameter/PipeParameters.java +++ b/iotdb-api/pipe-api/src/main/java/org/apache/iotdb/pipe/api/customizer/parameter/PipeParameters.java @@ -356,15 +356,17 @@ public class PipeParameters { } private static class KeyReducer { - - private static final Set<String> PREFIXES = new HashSet<>(); + private static final Set<String> FIRST_PREFIXES = new HashSet<>(); + private static final Set<String> SECOND_PREFIXES = new HashSet<>(); static { - PREFIXES.add("extractor."); - PREFIXES.add("source."); - PREFIXES.add("processor."); - PREFIXES.add("connector."); - PREFIXES.add("sink."); + FIRST_PREFIXES.add("extractor."); + FIRST_PREFIXES.add("source."); + FIRST_PREFIXES.add("processor."); + FIRST_PREFIXES.add("connector."); + FIRST_PREFIXES.add("sink."); + + SECOND_PREFIXES.add("opcua."); } static String shallowReduce(String key) { @@ -380,14 +382,22 @@ public class PipeParameters { return key; } - static String reduce(final String key) { + public static String reduce(String key) { if (key == null) { return null; } - final String lowerCaseKey = key.toLowerCase(); - for (final String prefix : PREFIXES) { + String lowerCaseKey = key.toLowerCase(); + for (final String prefix : FIRST_PREFIXES) { if (lowerCaseKey.startsWith(prefix)) { - return key.substring(prefix.length()); + key = key.substring(prefix.length()); + lowerCaseKey = lowerCaseKey.substring(prefix.length()); + break; + } + } + for (final String prefix : SECOND_PREFIXES) { + if (lowerCaseKey.startsWith(prefix)) { + key = key.substring(prefix.length()); + break; } } return key;
