File tree Expand file tree Collapse file tree
java/tsfile/src/main/java/org/apache/tsfile/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ public static Integer parseDateExpressionToInt(String dateExpression) {
4848 throw new DateTimeParseException (
4949 "Invalid date format. Please use YYYY-MM-DD format." , dateExpression , 0 );
5050 }
51- if (date .getYear () < 1000 ) {
51+ if (date .getYear () < 1000 || date . getYear () > 9999 ) {
5252 throw new DateTimeParseException ("Year must be between 1000 and 9999." , dateExpression , 0 );
5353 }
5454 return date .getYear () * 10000 + date .getMonthValue () * 100 + date .getDayOfMonth ();
@@ -58,7 +58,7 @@ public static Integer parseDateExpressionToInt(LocalDate localDate) {
5858 if (localDate == null ) {
5959 throw new DateTimeParseException ("Date expression is null or empty." , "" , 0 );
6060 }
61- if (localDate .getYear () < 1000 ) {
61+ if (localDate .getYear () < 1000 || localDate . getYear () > 9999 ) {
6262 throw new DateTimeParseException (
6363 "Year must be between 1000 and 9999." , localDate .format (DATE_FORMATTER ), 0 );
6464 }
You can’t perform that action at this time.
0 commit comments