From ea29eafc9b4b2503379706303f80a44dbec7be9f Mon Sep 17 00:00:00 2001 From: "Ma,Gang" Date: Tue, 27 Mar 2018 13:45:03 +0800 Subject: [PATCH] KYLIN-3320 CubeStatsReader cannot print stats properly for some cube --- .../org/apache/kylin/cube/cuboid/TreeCuboidScheduler.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/core-cube/src/main/java/org/apache/kylin/cube/cuboid/TreeCuboidScheduler.java b/core-cube/src/main/java/org/apache/kylin/cube/cuboid/TreeCuboidScheduler.java index 45b741e..3808e59 100644 --- a/core-cube/src/main/java/org/apache/kylin/cube/cuboid/TreeCuboidScheduler.java +++ b/core-cube/src/main/java/org/apache/kylin/cube/cuboid/TreeCuboidScheduler.java @@ -27,8 +27,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import javax.annotation.Nullable; - import org.apache.kylin.cube.CubeInstance; import org.apache.kylin.cube.model.AggregationGroup; import org.apache.kylin.cube.model.CubeDesc; @@ -36,7 +34,6 @@ import org.apache.kylin.cube.model.CubeDesc; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Function; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; @@ -122,13 +119,11 @@ public class TreeCuboidScheduler extends CuboidScheduler { throw new IllegalArgumentException("the cuboid:" + cuboidId + " is not exist in the tree"); } - return Lists.transform(node.children, new Function() { - @Nullable - @Override - public Long apply(@Nullable TreeNode input) { - return input.cuboidId; - } - }); + List result = Lists.newArrayList(); + for (TreeNode child : node.children) { + result.add(child.cuboidId); + } + return result; } public long findBestMatchCuboid(long cuboidId) { -- 2.6.4