diff --git a/java/tsfile/src/main/java/org/apache/tsfile/read/common/block/column/IntColumnBuilder.java b/java/tsfile/src/main/java/org/apache/tsfile/read/common/block/column/IntColumnBuilder.java index e78eac1db..4148ad7bf 100644 --- a/java/tsfile/src/main/java/org/apache/tsfile/read/common/block/column/IntColumnBuilder.java +++ b/java/tsfile/src/main/java/org/apache/tsfile/read/common/block/column/IntColumnBuilder.java @@ -23,10 +23,12 @@ import org.apache.tsfile.block.column.ColumnBuilder; import org.apache.tsfile.block.column.ColumnBuilderStatus; import org.apache.tsfile.enums.TSDataType; +import org.apache.tsfile.utils.DateUtils; import org.apache.tsfile.utils.RamUsageEstimator; import org.apache.tsfile.utils.TsPrimitiveType; import org.apache.tsfile.write.UnSupportedDataTypeException; +import java.time.LocalDate; import java.util.Arrays; import static java.lang.Math.max; @@ -83,6 +85,9 @@ public ColumnBuilder writeObject(Object value) { if (value instanceof Integer) { writeInt((Integer) value); return this; + } else if (value instanceof LocalDate) { + writeInt(DateUtils.parseDateExpressionToInt((LocalDate) value)); + return this; } throw new UnSupportedDataTypeException("IntegerColumn only support Integer data type"); }