This is an automated email from the ASF dual-hosted git repository. nic pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/kylin.git
The following commit(s) were added to refs/heads/master by this push: new 40cab4f KYLIN-4121 Cleanup hive view intermediate tables after job be finished 40cab4f is described below commit 40cab4f164fbeaeba441cefb246437eb9cb02c94 Author: rupengwang <wangrup...@live.cn> AuthorDate: Fri Aug 2 21:18:52 2019 +0800 KYLIN-4121 Cleanup hive view intermediate tables after job be finished --- .../org/apache/kylin/source/hive/GarbageCollectionStep.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source-hive/src/main/java/org/apache/kylin/source/hive/GarbageCollectionStep.java b/source-hive/src/main/java/org/apache/kylin/source/hive/GarbageCollectionStep.java index ba7c77a..92ac7fb 100644 --- a/source-hive/src/main/java/org/apache/kylin/source/hive/GarbageCollectionStep.java +++ b/source-hive/src/main/java/org/apache/kylin/source/hive/GarbageCollectionStep.java @@ -46,8 +46,6 @@ public class GarbageCollectionStep extends AbstractExecutable { StringBuffer output = new StringBuffer(); try { output.append(cleanUpIntermediateFlatTable(config)); - // don't drop view to avoid concurrent issue - //output.append(cleanUpHiveViewIntermediateTable(config)); } catch (IOException e) { logger.error("job:" + getId() + " execute finished with exception", e); return ExecuteResult.createError(e); @@ -56,6 +54,7 @@ public class GarbageCollectionStep extends AbstractExecutable { return new ExecuteResult(ExecuteResult.State.SUCCEED, output.toString()); } + //clean up both hive intermediate flat table and view table private String cleanUpIntermediateFlatTable(KylinConfig config) throws IOException { StringBuffer output = new StringBuffer(); final HiveCmdBuilder hiveCmdBuilder = new HiveCmdBuilder(); @@ -92,9 +91,14 @@ public class GarbageCollectionStep extends AbstractExecutable { setParam("oldHiveTables", StringUtil.join(tableIdentity, ",")); } + //get intermediate fact table and lookup table(if exists) private List<String> getIntermediateTables() { List<String> intermediateTables = Lists.newArrayList(); - String[] tables = StringUtil.splitAndTrim(getParam("oldHiveTables"), ","); + String hiveTables = getParam("oldHiveTables"); + if (this.getParams().containsKey("oldHiveViewIntermediateTables")) { + hiveTables += ("," + getParam("oldHiveViewIntermediateTables")); + } + String[] tables = StringUtil.splitAndTrim(hiveTables, ","); for (String t : tables) { intermediateTables.add(t); }