public static Date parseDate(final String text) {
    Objects.requireNonNull(text);

    // Date is a mutable class; do not return cached value
    Date result = new Date();
    return (parseDate(text, result)) ? result : null;
  }
Obtains an instance of Date from a text string such as 2021-02-21.

@param text the text to parse
@return The Date objects generated from parsing the text or null if the
        text could not be parsed
@throws NullPointerException if {@code text} is null
common/src/java/org/apache/hive/common/util/DateParser.java