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/06/12 14:44:32 UTC

[kylin] branch master updated: KYLIN-3388 remove create redistribute flat hive table step if not set distribute column

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 c8de73d  KYLIN-3388 remove create redistribute flat hive table step if not set distribute column
c8de73d is described below

commit c8de73d85b607eebb13a484b3796cbf28167430d
Author: Chao Long <wa...@qq.com>
AuthorDate: Mon Jun 11 21:53:20 2018 +0800

    KYLIN-3388 remove create redistribute flat hive table step if not set distribute column
---
 core-job/src/main/java/org/apache/kylin/job/JoinedFlatTable.java | 6 +-----
 .../src/main/java/org/apache/kylin/source/hive/HiveMRInput.java  | 9 +++++----
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/core-job/src/main/java/org/apache/kylin/job/JoinedFlatTable.java b/core-job/src/main/java/org/apache/kylin/job/JoinedFlatTable.java
index 57e1c40..a6c6daa 100644
--- a/core-job/src/main/java/org/apache/kylin/job/JoinedFlatTable.java
+++ b/core-job/src/main/java/org/apache/kylin/job/JoinedFlatTable.java
@@ -189,11 +189,7 @@ public class JoinedFlatTable {
     }
 
     private static void appendDistributeStatement(StringBuilder sql, TblColRef redistCol) {
-        if (redistCol != null) {
-            sql.append(" DISTRIBUTE BY ").append(colName(redistCol, true)).append(";\n");
-        } else {
-            sql.append(" DISTRIBUTE BY RAND()").append(";\n");
-        }
+        sql.append(" DISTRIBUTE BY ").append(colName(redistCol, true)).append(";\n");
     }
 
     private static void appendClusterStatement(StringBuilder sql, TblColRef clusterCol) {
diff --git a/source-hive/src/main/java/org/apache/kylin/source/hive/HiveMRInput.java b/source-hive/src/main/java/org/apache/kylin/source/hive/HiveMRInput.java
index 0e791eb..8653500 100644
--- a/source-hive/src/main/java/org/apache/kylin/source/hive/HiveMRInput.java
+++ b/source-hive/src/main/java/org/apache/kylin/source/hive/HiveMRInput.java
@@ -23,7 +23,6 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Set;
 
-import com.google.common.collect.Lists;
 import org.apache.commons.lang.StringUtils;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -59,6 +58,7 @@ import org.apache.kylin.metadata.model.TableDesc;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 
 public class HiveMRInput implements IMRInput {
@@ -153,7 +153,9 @@ public class HiveMRInput implements IMRInput {
 
             // then count and redistribute
             if (cubeConfig.isHiveRedistributeEnabled()) {
-                jobFlow.addTask(createRedistributeFlatHiveTableStep(hiveInitStatements, cubeName));
+                if (flatDesc.getClusterBy() != null || flatDesc.getDistributedBy() != null) {
+                    jobFlow.addTask(createRedistributeFlatHiveTableStep(hiveInitStatements, cubeName));
+                }
             }
 
             // special for hive
@@ -449,8 +451,7 @@ public class HiveMRInput implements IMRInput {
             }
             config.getCliCommandExecutor().execute(hiveCmdBuilder.build());
             rmdirOnHDFS(getExternalDataPaths());
-            output.append(
-                    "Path " + getExternalDataPaths() + " is deleted. \n");
+            output.append("Path " + getExternalDataPaths() + " is deleted. \n");
 
             return output.toString();
         }

-- 
To stop receiving notification emails like this one, please contact
shaofengshi@apache.org.