diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/memory/InsertNodeMemoryEstimator.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/memory/InsertNodeMemoryEstimator.java index 2f78b0927442..ed34f0de3103 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/memory/InsertNodeMemoryEstimator.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/memory/InsertNodeMemoryEstimator.java @@ -669,6 +669,10 @@ public static long sizeOfValues( RamUsageEstimator.alignObjectSize( NUM_BYTES_ARRAY_HEADER + NUM_BYTES_OBJECT_REF * values.length); for (int i = 0; i < values.length; i++) { + if (measurementSchemas[i] == null || measurementSchemas[i].getType() == null) { + size += NUM_BYTES_OBJECT_HEADER; + continue; + } switch (measurementSchemas[i].getType()) { case INT64: case TIMESTAMP: diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TreeDeviceNormalSchema.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TreeDeviceNormalSchema.java index 9b44b7feead7..8651e8199e57 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TreeDeviceNormalSchema.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TreeDeviceNormalSchema.java @@ -63,7 +63,7 @@ public int update(final String[] measurements, final IMeasurementSchema[] schema for (int i = 0; i < length; ++i) { // Skip this to avoid instance creation/gc for writing performance - if (measurementMap.containsKey(measurements[i])) { + if (measurements[i] == null || measurementMap.containsKey(measurements[i])) { continue; } diff += putEntry(measurements[i], schemas[i], null);