public static Date parseDate(final String str) {
    try {
      return new Date(TimeUnit.DAYS.toMillis(
          LocalDate.parse(PartialStringToTimestampParser.completeDate(str))
          .toEpochDay()));
    } catch (DateTimeParseException e) {
      throw new KsqlException("Failed to parse date '" + str
          + "': " + e.getMessage()
          + DATE_HELP_MESSAGE,
          e
      );
    }
  }
@Test
  public void shouldParseDate() {
    assertThat(SqlTimeTypes.parseDate("1990"), is(new Date(631152000000L)));
    assertThat(SqlTimeTypes.parseDate("1990-01"), is(new Date(631152000000L)));
    assertThat(SqlTimeTypes.parseDate("1990-01-01"), is(new Date(631152000000L)));
  }