Skip to content

Commit f6e68bd

Browse files
committed
Fix review
1 parent 782e087 commit f6e68bd

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/RelationalInsertRowsNode.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
import java.util.List;
4444
import java.util.Map;
4545

46+
import static org.apache.iotdb.db.utils.ObjectTypeUtils.generateObjectBinary;
47+
4648
public class RelationalInsertRowsNode extends InsertRowsNode {
4749
// deviceId cache for Table-view insertion
4850
private IDeviceID[] deviceIDs;
@@ -223,11 +225,8 @@ private void handleObjectValue(
223225
objectNode.setDataRegionReplicaSet(dataRegionReplicaSet);
224226
writePlanNodeList.add(objectNode);
225227
if (isEoF) {
226-
ByteBuffer valueBytes =
227-
ByteBuffer.allocate(relativePath.getSerializeSizeToObjectValue() + Long.BYTES);
228-
valueBytes.putLong(offset + content.length);
229-
relativePath.serializeToObjectValue(valueBytes);
230-
((Binary) values[j]).setValues(valueBytes.array());
228+
((Binary) values[j])
229+
.setValues(generateObjectBinary(offset + content.length, relativePath).getValues());
231230
insertRowNode.setValues(values);
232231
} else {
233232
values[j] = null;

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/RelationalInsertTabletNode.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
import java.util.Map;
5656
import java.util.Map.Entry;
5757

58+
import static org.apache.iotdb.db.utils.ObjectTypeUtils.generateObjectBinary;
59+
5860
public class RelationalInsertTabletNode extends InsertTabletNode {
5961

6062
// deviceId cache for Table-view insertion
@@ -478,11 +480,8 @@ private void handleObjectValue(
478480
objectNode.setDataRegionReplicaSet(entry.getKey());
479481
result.add(objectNode);
480482
if (isEoF) {
481-
ByteBuffer valueBytes =
482-
ByteBuffer.allocate(relativePath.getSerializeSizeToObjectValue() + Long.BYTES);
483-
valueBytes.putLong(offset + content.length);
484-
relativePath.serializeToObjectValue(valueBytes);
485-
((Binary[]) columns[column])[j] = new Binary(valueBytes.array());
483+
((Binary[]) columns[column])[j] =
484+
generateObjectBinary(offset + content.length, relativePath);
486485
} else {
487486
((Binary[]) columns[column])[j] = null;
488487
if (bitMaps == null) {

iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/function/RecordObjectTypeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void tearDown() throws IOException {
7878
Files.delete(file.toPath());
7979
}
8080
}
81-
config.setRestrictObjectLimit(true);
81+
config.setRestrictObjectLimit(false);
8282
}
8383

8484
@Test

0 commit comments

Comments
 (0)