Skip to content

Commit 027a119

Browse files
HBASE-28185 Alter table to set TTL using hbase shell failed when ttl string is not match format (#5494)
Signed-off-by: Duo Zhang <[email protected]>
1 parent fa4c896 commit 027a119

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

hbase-common/src/main/java/org/apache/hadoop/hbase/util/PrettyPrinter.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,11 @@ private static long humanReadableIntervalToSec(final String humanReadableInterva
184184
hours = matcher.group(6);
185185
minutes = matcher.group(8);
186186
seconds = matcher.group(10);
187+
} else {
188+
LOG.warn("Given interval value '{}' is not a number and does not match human readable format,"
189+
+ " value will be set to 0.", humanReadableInterval);
187190
}
191+
188192
ttl = 0;
189193
ttl += days != null ? Long.parseLong(days) * HConstants.DAY_IN_SECONDS : 0;
190194
ttl += hours != null ? Long.parseLong(hours) * HConstants.HOUR_IN_SECONDS : 0;

0 commit comments

Comments
 (0)