public static Date convertStringToDate(String date) {
    LocalDate val = LocalDate.parse(date, DATE_FORMATTER);
    return java.sql.Date.valueOf(val);
  }
Converts string format date to java.sql.Date.
@param date Date in string format.
@return java.sql.Date object.
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/MetaStoreUtils.java