healchow commented on code in PR #6832: URL: https://github.com/apache/inlong/pull/6832#discussion_r1049186857
########## inlong-sort/sort-connectors/doris/src/main/java/org/apache/inlong/sort/doris/util/DorisParseUtils.java: ########## @@ -67,4 +69,26 @@ public static String escapeString(String hexStr) { return buf.toString(); } + /** + * A utility used to change epoch dates into normal dates + * <p/> + * Example input: 0 + * Example output: 1970-01-01 + * + * @param obj the epoch date that is either long or int + * @return the transformed local date + */ + public static LocalDate epochToDate(Object obj) { + if (obj instanceof Long) { + return LocalDate.ofEpochDay((Long) obj); + } + if (obj instanceof Integer) { + return LocalDate.ofEpochDay((Integer) obj); + } + throw new IllegalArgumentException( + "Unable to convert to LocalDate from unexpected value '" + + obj + + "' of type " + + obj.getClass().getName()); Review Comment: ```suggestion throw new IllegalArgumentException( "Convert to LocalDate failed from unexpected value '" + obj + "' of type " + obj.getClass().getName()); ``` -- 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...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org