APISonar


org.apache.hadoop.hive.metastore.api.Date.Date

> org > apache > hadoop > hive > metastore > api > Date > Date
org APIs apache APIs hadoop APIs hive APIs metastore APIs api APIs Date APIs Date APIs

Example 1
public static Date toMetastoreDate(LocalDate date)
    {
        return new Date(date.toEpochDay());
    }
Example 2
private Date readDateValue(String dateStr) {
    // try either yyyy-mm-dd, or integer representing days since epoch
    try {
      DateWritable writableVal = new DateWritable(java.sql.Date.valueOf(dateStr));
      return new Date(writableVal.getDays());
    } catch (IllegalArgumentException err) {
      // Fallback to integer parsing
      LOG.debug("Reading date value as days since epoch: {}", dateStr);
      return new Date(Long.parseLong(dateStr));
    }
  }