From 5c547a4d276c7b3e19620c5e7ba4e6bb5620f879 Mon Sep 17 00:00:00 2001 From: shuwenwei Date: Wed, 9 Jul 2025 14:37:07 +0800 Subject: [PATCH] Ignore the null value passed in the Tablet.addValue method --- .../main/java/org/apache/tsfile/write/record/Tablet.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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);