mdayakar commented on code in PR #4760: URL: https://github.com/apache/hive/pull/4760#discussion_r1343813888
########## ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java: ########## @@ -1804,9 +1803,9 @@ private static String normalizeDateCol(Object colValue) throws SemanticException throw new SemanticException("Unexpected date type " + colValue.getClass()); } try { - return MetaStoreUtils.PARTITION_DATE_FORMAT.get().format( - MetaStoreUtils.PARTITION_DATE_FORMAT.get().parse(value.toString())); - } catch (ParseException e) { + return MetaStoreUtils.convertDateToString( + MetaStoreUtils.convertStringToDate(value.toString())); + } catch (Exception e) { throw new SemanticException(e); } } Review Comment: In case of `ParseException`, they were catching it and throwing `SemanticException`, now new code don't throw any exception in normal scenario so for the safer side catching `Exception` and throwing back `SemanticException`. -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org