public static Date resolveAbsoluteDate(final String str) throws LensException { try { return stringToDateCache.get(str, () -> ABSDATE_PARSER.get().parse(getAbsDateFormatString(str))); } catch (Exception e) { log.error("Invalid date format. expected only {} date provided:{}", ABSDATE_FMT, str, e); throw new LensException(LensCubeErrorCode.WRONG_TIME_RANGE_FORMAT.getLensErrorInfo(), ABSDATE_FMT, str); } }
public static Date resolveAbsoluteDate(final String str) throws LensException { try { return stringToDateCache.get(str, () -> ABSDATE_PARSER.get().parse(getAbsDateFormatString(str))); } catch (Exception e) { log.error("Invalid date format. expected only {} date provided:{}", ABSDATE_FMT, str, e); throw new LensException(LensCubeErrorCode.WRONG_TIME_RANGE_FORMAT.getLensErrorInfo(), ABSDATE_FMT, str); } }
hql = rewrite("select msr12 from basecube where " + TWO_DAYS_RANGE, conf); String dTimeWhereClause = "basecube.d_time >= '" + HIVE_QUERY_DATE_PARSER.get().format(ABSDATE_PARSER.get().parse( getAbsDateFormatString(getDateUptoHours( TWODAYS_BACK)))) + "' and " + "basecube.d_time < '" + HIVE_QUERY_DATE_PARSER.get().format(ABSDATE_PARSER.get().parse( getAbsDateFormatString(getDateUptoHours(NOW)))); String pTimeWhereClause = "basecube.processing_time >= '" + HIVE_QUERY_DATE_PARSER.get().format(ABSDATE_PARSER.get().parse( getAbsDateFormatString(getDateUptoHours( DateUtils.addDays(TWODAYS_BACK, -5))))) + "' and " + "basecube.processing_time < '" + HIVE_QUERY_DATE_PARSER.get().format(ABSDATE_PARSER.get().parse( getAbsDateFormatString(getDateUptoHours(DateUtils.addDays(NOW, 5))))); expected = getExpectedQuery(BASE_CUBE_NAME, "select sum(basecube.msr12) as `msr12` FROM ", null, " and " + dTimeWhereClause + " and " + pTimeWhereClause,