diff --git a/java/tsfile/src/main/java/org/apache/tsfile/write/record/Tablet.java b/java/tsfile/src/main/java/org/apache/tsfile/write/record/Tablet.java index d84cd0577..ac03949a4 100644 --- a/java/tsfile/src/main/java/org/apache/tsfile/write/record/Tablet.java +++ b/java/tsfile/src/main/java/org/apache/tsfile/write/record/Tablet.java @@ -507,6 +507,9 @@ public void addValue(int rowIndex, int columnIndex, String val) { throw new IllegalArgumentException( "The data type of column index " + columnIndex + " is not TEXT/STRING/BLOB"); } + if (val == null) { + return; + } final Binary[] sensor = (Binary[]) values[columnIndex]; sensor[rowIndex] = new Binary(val, TSFileConfig.STRING_CHARSET); updateBitMap(rowIndex, columnIndex, false); @@ -524,6 +527,9 @@ public void addValue(int rowIndex, int columnIndex, byte[] val) { throw new IllegalArgumentException( "The data type of column index " + columnIndex + " is not TEXT/STRING/BLOB"); } + if (val == null) { + return; + } final Binary[] sensor = (Binary[]) values[columnIndex]; sensor[rowIndex] = new Binary(val); updateBitMap(rowIndex, columnIndex, false); @@ -541,6 +547,9 @@ public void addValue(int rowIndex, int columnIndex, LocalDate val) { throw new IllegalArgumentException( "The data type of column index " + columnIndex + " is not DATE"); } + if (val == null) { + return; + } final LocalDate[] sensor = (LocalDate[]) values[columnIndex]; sensor[rowIndex] = val; updateBitMap(rowIndex, columnIndex, false);