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 bfcc03772d3 [IOTDB-6021] Pipe: NPE when sync TEXT timeseries with null
fields between IoTDB instances using file mode with pattern filter (#10269)
(#10270)
bfcc03772d3 is described below
commit bfcc03772d380ec8adbc92db0f666e52dba7819c
Author: Steve Yurong Su <[email protected]>
AuthorDate: Thu Jun 22 13:44:38 2023 +0800
[IOTDB-6021] Pipe: NPE when sync TEXT timeseries with null fields between
IoTDB instances using file mode with pattern filter (#10269) (#10270)
(cherry picked from commit 06d353158c788833509ffcc5c3d9dfa623be19b1)
---
.../event/common/tsfile/TsFileInsertionDataTabletIterator.java | 9 ++++-----
.../apache/iotdb/db/pipe/task/subtask/PipeConnectorSubtask.java | 5 +++++
.../main/java/org/apache/iotdb/tsfile/write/record/Tablet.java | 2 ++
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git
a/server/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/TsFileInsertionDataTabletIterator.java
b/server/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/TsFileInsertionDataTabletIterator.java
index 63b2b15d403..4ff37e21741 100644
---
a/server/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/TsFileInsertionDataTabletIterator.java
+++
b/server/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/TsFileInsertionDataTabletIterator.java
@@ -128,11 +128,10 @@ public class TsFileInsertionDataTabletIterator implements
Iterator<Tablet> {
final int fieldSize = fields.size();
for (int i = 0; i < fieldSize; i++) {
final Field field = fields.get(i);
- if (field == null || field.getDataType() == null) {
- tablet.bitMaps[i].mark(rowIndex);
- } else {
- tablet.addValue(measurements.get(i), rowIndex,
field.getObjectValue(field.getDataType()));
- }
+ tablet.addValue(
+ measurements.get(i),
+ rowIndex,
+ field == null ? null : field.getObjectValue(field.getDataType()));
}
tablet.rowSize++;
diff --git
a/server/src/main/java/org/apache/iotdb/db/pipe/task/subtask/PipeConnectorSubtask.java
b/server/src/main/java/org/apache/iotdb/db/pipe/task/subtask/PipeConnectorSubtask.java
index 47dd1ba7e03..4dc322b90ed 100644
---
a/server/src/main/java/org/apache/iotdb/db/pipe/task/subtask/PipeConnectorSubtask.java
+++
b/server/src/main/java/org/apache/iotdb/db/pipe/task/subtask/PipeConnectorSubtask.java
@@ -160,6 +160,11 @@ public class PipeConnectorSubtask extends PipeSubtask {
// stop current pipe task if failed to reconnect to the target system
after MAX_RETRY_TIMES
return;
}
+ } else {
+ LOGGER.warn(
+ "A non-PipeConnectionException occurred, exception message: {}",
+ throwable.getMessage(),
+ throwable);
}
// handle other exceptions as usual
diff --git
a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/record/Tablet.java
b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/record/Tablet.java
index ea1cd5846ca..c213fc74a2f 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/record/Tablet.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/record/Tablet.java
@@ -586,6 +586,8 @@ public class Tablet {
boolean isNotNull =
BytesUtils.byteToBool(ReadWriteIOUtils.readByte(byteBuffer));
if (isNotNull) {
binaryValues[index] = ReadWriteIOUtils.readBinary(byteBuffer);
+ } else {
+ binaryValues[index] = Binary.EMPTY_VALUE;
}
}
values[i] = binaryValues;