Skip to content

Commit

Permalink
KYLIN-4107 Fix bug of StorageCleanupJob fails to delete Hive tables w…
Browse files Browse the repository at this point in the history
…ith "Argument list too long" error
  • Loading branch information
weibin0516 authored and nichunen committed Aug 5, 2019
1 parent c39ba7f commit d2c3cd3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import javax.annotation.Nullable;

import com.google.common.collect.Lists;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.OptionBuilder;
import org.apache.commons.cli.Options;
Expand Down Expand Up @@ -378,7 +379,10 @@ public boolean apply(@Nullable String input) {

if (delete) {
try {
deleteHiveTables(allHiveTablesNeedToBeDeleted, segmentId2JobId);
List<List<String>> tablesList = Lists.partition(allHiveTablesNeedToBeDeleted, 20);
for (List<String> tables: tablesList) {
deleteHiveTables(tables, segmentId2JobId);
}
} catch (IOException e) {
logger.error("Error during deleting Hive tables", e);
}
Expand Down

0 comments on commit d2c3cd3

Please sign in to comment.