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 d4ad0fa  KYLIN-3699 Spark cubing failed when build with empty data
d4ad0fa is described below

commit d4ad0fa0f11fa5f5b40e77a3631a6b03b3ac7a12
Author: chao long <wayn...@qq.com>
AuthorDate: Tue Dec 18 16:57:14 2018 +0800

    KYLIN-3699 Spark cubing failed when build with empty data
---
 .../src/main/java/org/apache/kylin/common/util/HadoopUtil.java        | 4 ++--
 .../main/java/org/apache/kylin/engine/mr/common/CubeStatsReader.java  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/core-common/src/main/java/org/apache/kylin/common/util/HadoopUtil.java 
b/core-common/src/main/java/org/apache/kylin/common/util/HadoopUtil.java
index 5d09ea7..4afce58 100644
--- a/core-common/src/main/java/org/apache/kylin/common/util/HadoopUtil.java
+++ b/core-common/src/main/java/org/apache/kylin/common/util/HadoopUtil.java
@@ -256,8 +256,8 @@ public class HadoopUtil {
 
         if (fileStatuses != null && fileStatuses.length > 0) {
             return isSequenceFile(conf, fileStatuses[0].getPath());
+        } else {
+            return true;
         }
-
-        return false;
     }
 }
diff --git 
a/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/CubeStatsReader.java
 
b/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/CubeStatsReader.java
index be5bdbf..58f0e66 100644
--- 
a/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/CubeStatsReader.java
+++ 
b/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/CubeStatsReader.java
@@ -299,7 +299,7 @@ public class CubeStatsReader {
         Map<Long, Double> cuboidSizeMap = getCuboidSizeMap();
         double ret = 0;
         for (Long cuboidId : layeredCuboids.get(level)) {
-            ret += cuboidSizeMap.get(cuboidId);
+            ret += cuboidSizeMap.get(cuboidId) == null ? 0.0 : 
cuboidSizeMap.get(cuboidId);
         }
 
         logger.info("Estimating size for layer {}, all cuboids are {}, total 
size is {}", level,

Reply via email to