diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/pattern/IoTDBTreePatternTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/pattern/IoTDBTreePatternTest.java index 9cb68f89fdf0..e2a7bc0a4b51 100644 --- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/pattern/IoTDBTreePatternTest.java +++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/pattern/IoTDBTreePatternTest.java @@ -143,5 +143,6 @@ public void testApplyReversedIndexes() { System.exit(-1); } } + Assert.assertEquals(null, applyReversedIndexesOnList(filteredIndexes, null)); } } diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/IoTDBTreePattern.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/IoTDBTreePattern.java index 9e54c1087acf..2becc993968c 100644 --- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/IoTDBTreePattern.java +++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/IoTDBTreePattern.java @@ -31,6 +31,8 @@ import org.apache.tsfile.file.metadata.IDeviceID; +import javax.annotation.Nullable; + import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -67,7 +69,10 @@ private String getDefaultPattern() { //////////////////////////// Tree Pattern Operations //////////////////////////// public static List applyReversedIndexesOnList( - final List filteredIndexes, final List originalList) { + final List filteredIndexes, final @Nullable List originalList) { + if (Objects.isNull(originalList)) { + return null; + } // No need to sort, the caller guarantees that the filtered sequence == original sequence final List filteredList = new ArrayList<>(originalList.size() - filteredIndexes.size()); int filteredIndexPos = 0;