You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2018/09/12 10:27:14 UTC
[kylin] branch master updated: KYLIN-3525 Reserve intermediate flat
table data if kylin.source.hive.keep-flat-table set to true
This is an automated email from the ASF dual-hosted git repository.
shaofengshi 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 375acde KYLIN-3525 Reserve intermediate flat table data if kylin.source.hive.keep-flat-table set to true
375acde is described below
commit 375acdedf88a298bfcd2d2dddbf6f8551f42e427
Author: hit-lacus <hi...@126.com>
AuthorDate: Tue Sep 11 18:07:21 2018 +0800
KYLIN-3525 Reserve intermediate flat table data if kylin.source.hive.keep-flat-table set to true
---
.../apache/kylin/source/hive/GarbageCollectionStep.java | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 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 ac25d07..7dc8260 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
@@ -60,16 +60,17 @@ public class GarbageCollectionStep extends AbstractExecutable {
StringBuffer output = new StringBuffer();
final HiveCmdBuilder hiveCmdBuilder = new HiveCmdBuilder();
final List<String> hiveTables = this.getIntermediateTables();
- for (String hiveTable : hiveTables) {
- if (config.isHiveKeepFlatTable() == false && StringUtils.isNotEmpty(hiveTable)) {
- hiveCmdBuilder.addStatement("USE " + config.getHiveDatabaseForIntermediateTable() + ";");
- hiveCmdBuilder.addStatement("DROP TABLE IF EXISTS " + hiveTable + ";");
-
- output.append("Hive table " + hiveTable + " is dropped. \n");
+ if (!config.isHiveKeepFlatTable()){
+ for (String hiveTable : hiveTables) {
+ if (StringUtils.isNotEmpty(hiveTable)) {
+ hiveCmdBuilder.addStatement("USE " + config.getHiveDatabaseForIntermediateTable() + ";");
+ hiveCmdBuilder.addStatement("DROP TABLE IF EXISTS " + hiveTable + ";");
+ output.append("Hive table " + hiveTable + " is dropped. \n");
+ }
}
+ rmdirOnHDFS(getExternalDataPaths());
}
config.getCliCommandExecutor().execute(hiveCmdBuilder.build());
- rmdirOnHDFS(getExternalDataPaths());
output.append("Path " + getExternalDataPaths() + " is deleted. \n");
return output.toString();