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 (#5494)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 027a119)
  • Loading branch information
chaijunjie0101 authored and Apache9 committed Nov 6, 2023
1 parent 8b1f690 commit c0b5e96
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,11 @@ 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 does not match human readable format,"
+ " value will be 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 c0b5e96

Please sign in to comment.