diff --git a/lens-cube/src/main/java/org/apache/lens/cube/metadata/DateUtil.java b/lens-cube/src/main/java/org/apache/lens/cube/metadata/DateUtil.java index 17e30a1d3..6eb23d0ed 100644 --- a/lens-cube/src/main/java/org/apache/lens/cube/metadata/DateUtil.java +++ b/lens-cube/src/main/java/org/apache/lens/cube/metadata/DateUtil.java @@ -182,8 +182,8 @@ public static Date resolveRelativeDate(String str, Date now) throws LensExceptio Matcher relativeMatcher = P_RELATIVE.matcher(str); if (relativeMatcher.find()) { String nowWithGranularity = relativeMatcher.group(); - nowWithGranularity = nowWithGranularity.replaceAll("now", ""); - nowWithGranularity = nowWithGranularity.replaceAll("\\.", ""); + nowWithGranularity = nowWithGranularity.replace("now", ""); + nowWithGranularity = nowWithGranularity.replace(".", ""); Matcher granularityMatcher = P_UNIT.matcher(nowWithGranularity); if (granularityMatcher.find()) {