You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kylin.apache.org by GitBox <gi...@apache.org> on 2018/09/12 10:27:13 UTC
[GitHub] shaofengshi closed pull request #230: KYLIN-3525 Reserve
intermediate flat table data if kylin.source.hive.keep-flat-table set to true
shaofengshi closed pull request #230: KYLIN-3525 Reserve intermediate flat table data if kylin.source.hive.keep-flat-table set to true
URL: https://github.com/apache/kylin/pull/230
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
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 ac25d07389..7dc8260980 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 @@ private String cleanUpIntermediateFlatTable(KylinConfig config) throws IOExcepti
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();
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services