Skip to content

Commit

Permalink
HBASE-28185 Alter table to set TTL using hbase shell failed when ttl …
Browse files Browse the repository at this point in the history
…string is not match format
  • Loading branch information
chaijunjie0101 committed Nov 2, 2023
1 parent fa4c896 commit 9c1ab80
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,12 @@ private static long humanReadableIntervalToSec(final String humanReadableInterva
hours = matcher.group(6);
minutes = matcher.group(8);
seconds = matcher.group(10);
} else {
LOG.warn(
"Given interval value : {} is not a number and not match human readable format, TTL will set to 0.",
humanReadableInterval);
}

ttl = 0;
ttl += days != null ? Long.parseLong(days) * HConstants.DAY_IN_SECONDS : 0;
ttl += hours != null ? Long.parseLong(hours) * HConstants.HOUR_IN_SECONDS : 0;
Expand Down

0 comments on commit 9c1ab80

Please sign in to comment.