kylin-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KYLIN-3525) kylin.source.hive.keep-flat-table=true will delete data
Date Wed, 12 Sep 2018 10:28:00 GMT

    [ https://issues.apache.org/jira/browse/KYLIN-3525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16611895#comment-16611895
] 

ASF GitHub Bot commented on KYLIN-3525:
---------------------------------------

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


> kylin.source.hive.keep-flat-table=true will delete data
> -------------------------------------------------------
>
>                 Key: KYLIN-3525
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3525
>             Project: Kylin
>          Issue Type: Bug
>          Components: Streaming
>    Affects Versions: v2.4.0
>            Reporter: wlxie
>            Assignee: XiaoXiang Yu
>            Priority: Minor
>             Fix For: v2.6.0
>
>         Attachments: 1535534470(1).png, HiveMRInput.java
>
>
> kylin.source.hive.keep-flat-table这个参数设置为true后,只是保留了hive表结构,但是数据还是被清除了,查看了源码,这个参数确实只是对表结构进行控制。如果希望数据也保存下来,并且是一个cube下面所有作业的数据都保存到一个表里面(目前是一个作业会产生一个表),是否有什么好的解决方案。
> 附件为v2.4.0源码
> 谢谢。



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message