This is an automated email from the ASF dual-hosted git repository.
rong pushed a commit to branch rel/1.2
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/rel/1.2 by this push:
new cd74743c907 [IOTDB-6015] Pipe: Not checking whether the tsfile data
loaded locally is in the same time partition during the loading process (#10250)
cd74743c907 is described below
commit cd74743c907c15a5bbc1eb13c2e105e98b625fc1
Author: yschengzi <[email protected]>
AuthorDate: Tue Jun 20 22:14:32 2023 +0800
[IOTDB-6015] Pipe: Not checking whether the tsfile data loaded locally is
in the same time partition during the loading process (#10250)
---
.../plan/planner/plan/node/load/LoadSingleTsFileNode.java | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git
a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/plan/node/load/LoadSingleTsFileNode.java
b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/plan/node/load/LoadSingleTsFileNode.java
index d68184b04d3..18627c7be19 100644
---
a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/plan/node/load/LoadSingleTsFileNode.java
+++
b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/plan/node/load/LoadSingleTsFileNode.java
@@ -86,7 +86,17 @@ public class LoadSingleTsFileNode extends WritePlanNode {
slotList.add(
new Pair<>(o,
TimePartitionUtils.getTimePartition(resource.getEndTime(o))));
});
- needDecodeTsFile = !isDispatchedToLocal(new
HashSet<>(partitionFetcher.apply(slotList)));
+
+ if (slotList.isEmpty()) {
+ throw new IllegalStateException(
+ String.format("Devices in TsFile %s is empty, this should not happen
here.", tsFile));
+ } else if (slotList.stream()
+ .anyMatch(slotPair ->
!slotPair.getRight().equals(slotList.get(0).right))) {
+ needDecodeTsFile = true;
+ } else {
+ needDecodeTsFile = !isDispatchedToLocal(new
HashSet<>(partitionFetcher.apply(slotList)));
+ }
+
if (!needDecodeTsFile && !resource.resourceFileExists()) {
resource.serialize();
}