sohardforaname commented on code in PR #18209:
URL: https://github.com/apache/doris/pull/18209#discussion_r1189458379


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/DateLiteral.java:
##########
@@ -204,4 +214,13 @@ public DateLiteral plusYears(int years) {
         LocalDateTime dateTime = DateUtils.getTime(DATE_FORMATTER, 
getStringValue()).plusYears(years);
         return new DateLiteral(dateTime.getYear(), dateTime.getMonthValue(), 
dateTime.getDayOfMonth());
     }
+
+    public LocalDateTime toJavaDateType() {
+        return LocalDateTime.of(((int) getYear()), ((int) getMonth()), ((int) 
getDay()), 0, 0, 0);
+    }
+
+    public static DateLiteral fromJavaDateType(LocalDateTime dateTime) {
+        return isDateOutOfRange(dateTime) ? null

Review Comment:
   it will throw exception



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to