This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/object_type by this push:
new 2f0ed6cc3b7 fix bug
2f0ed6cc3b7 is described below
commit 2f0ed6cc3b705873c6c908cf595d72e77c024f64
Author: HTHou <[email protected]>
AuthorDate: Mon Jul 7 12:05:15 2025 +0800
fix bug
---
.../plan/planner/plan/node/write/RelationalInsertTabletNode.java | 7 ++++---
.../db/storageengine/dataregion/memtable/TsFileProcessor.java | 7 +++++--
.../src/main/java/org/apache/iotdb/db/utils/ObjectWriter.java | 8 ++++++--
.../src/assembly/resources/conf/iotdb-system.properties.template | 1 -
4 files changed, 15 insertions(+), 8 deletions(-)
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/RelationalInsertTabletNode.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/RelationalInsertTabletNode.java
index cad719774f0..1f08a754453 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/RelationalInsertTabletNode.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/RelationalInsertTabletNode.java
@@ -119,13 +119,14 @@ public class RelationalInsertTabletNode extends
InsertTabletNode {
return fileNodesList;
}
- public Binary[] getObjectColumn() {
+ public List<Binary[]> getObjectColumns() {
+ List<Binary[]> objectColumns = new ArrayList<>();
for (int i = 0; i < columns.length; i++) {
if (dataTypes[i] == TSDataType.OBJECT) {
- return (Binary[]) columns[i];
+ objectColumns.add((Binary[]) columns[i]);
}
}
- return null;
+ return objectColumns;
}
@Override
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessor.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessor.java
index 114a11aa1b5..a4880f50bb1 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessor.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessor.java
@@ -571,7 +571,8 @@ public class TsFileProcessor {
(RelationalInsertTabletNode) insertTabletNode;
List<List<FileNode>> fileNodesList =
relationalInsertTabletNode.getFileNodeList();
if (fileNodesList != null) {
- for (List<FileNode> fileNodeList : fileNodesList) {
+ for (int j = 0; j < fileNodesList.size(); j++) {
+ List<FileNode> fileNodeList = fileNodesList.get(j);
for (int i = 0; i < fileNodeList.size(); i++) {
FileNode fileNode = fileNodeList.get(i);
String objectFileName =
@@ -586,6 +587,7 @@ public class TsFileProcessor {
try (ObjectWriter writer = new ObjectWriter(objectTmpFile)) {
writer.write(fileNode);
} catch (Exception e) {
+ results[i] =
RpcUtils.getStatus(TSStatusCode.INTERNAL_SERVER_ERROR, e.getMessage());
throw new WriteProcessException(e);
}
// TODO:[OBJECT] write file node wal
@@ -597,6 +599,7 @@ public class TsFileProcessor {
objectFile.toPath(),
StandardCopyOption.REPLACE_EXISTING);
} catch (IOException e) {
+ results[i] =
RpcUtils.getStatus(TSStatusCode.INTERNAL_SERVER_ERROR, e.getMessage());
throw new WriteProcessException(e);
}
String relativePathString =
@@ -616,7 +619,7 @@ public class TsFileProcessor {
System.arraycopy(
BytesUtils.longToBytes(objectFile.length()), 0, valueBytes,
0, Long.BYTES);
System.arraycopy(filePathBytes, 0, valueBytes, 4,
filePathBytes.length);
- relationalInsertTabletNode.getObjectColumn()[i] = new
Binary(valueBytes);
+ (relationalInsertTabletNode.getObjectColumns().get(j))[i] = new
Binary(valueBytes);
}
}
}
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ObjectWriter.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ObjectWriter.java
index a483f0d7c2d..2bc85453744 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ObjectWriter.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ObjectWriter.java
@@ -62,10 +62,14 @@ public class ObjectWriter implements AutoCloseable {
public void write(FileNode fileNode) throws IOException {
if (file.length() != fileNode.getOffset()) {
- throw new IOException("The file length is not equal to the file offset");
+ throw new IOException(
+ "The file length "
+ + file.length()
+ + " is not equal to the offset "
+ + fileNode.getOffset());
}
if (file.length() + fileNode.getContent().length >
config.getMaxObjectSizeInByte()) {
- throw new IOException("The file length is too large");
+ throw new IOException("The file length is larger than
max_object_file_size_in_bytes");
}
fos.write(fileNode.getContent());
}
diff --git
a/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties.template
b/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties.template
index 8c0d28a2332..15530845cc9 100644
---
a/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties.template
+++
b/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties.template
@@ -1246,7 +1246,6 @@ enable_tsfile_validation=false
# Unit: ms
tier_ttl_in_ms=-1
-
# The maximum size limit for a single object file.
# effectiveMode: hot_reload
# Datatype: long