Repository: kylin Updated Branches: refs/heads/master 5974fc087 -> e6698c8f0
KYLIN-1967 Skip empty cube segment Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/e6698c8f Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/e6698c8f Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/e6698c8f Branch: refs/heads/master Commit: e6698c8f054ce925adb041a85c21af8e886aa768 Parents: 5974fc0 Author: Li Yang <liy...@apache.org> Authored: Thu Oct 13 18:55:11 2016 +0800 Committer: Li Yang <liy...@apache.org> Committed: Thu Oct 13 18:55:59 2016 +0800 ---------------------------------------------------------------------- .../kylin/storage/gtrecord/CubeSegmentScanner.java | 2 ++ .../kylin/storage/gtrecord/GTCubeStorageQueryBase.java | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/e6698c8f/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/CubeSegmentScanner.java ---------------------------------------------------------------------- diff --git a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/CubeSegmentScanner.java b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/CubeSegmentScanner.java index 926ba48..6e19c09 100644 --- a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/CubeSegmentScanner.java +++ b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/CubeSegmentScanner.java @@ -69,6 +69,8 @@ public class CubeSegmentScanner implements IGTScanner { CubeScanRangePlanner scanRangePlanner; try { scanRangePlanner = new CubeScanRangePlanner(cubeSeg, cuboid, filter, dimensions, groups, metrics, context); + } catch (RuntimeException e) { + throw e; } catch (Exception e) { throw new RuntimeException(e); } http://git-wip-us.apache.org/repos/asf/kylin/blob/e6698c8f/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/GTCubeStorageQueryBase.java ---------------------------------------------------------------------- diff --git a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/GTCubeStorageQueryBase.java b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/GTCubeStorageQueryBase.java index 4ba134d..fa23be1 100644 --- a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/GTCubeStorageQueryBase.java +++ b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/GTCubeStorageQueryBase.java @@ -133,7 +133,16 @@ public abstract class GTCubeStorageQueryBase implements IStorageQuery { continue; } } - scanner = new CubeSegmentScanner(cubeSeg, cuboid, dimensionsD, groupsD, metrics, filterD, context, getGTStorage()); + try { + scanner = new CubeSegmentScanner(cubeSeg, cuboid, dimensionsD, groupsD, metrics, filterD, context, getGTStorage()); + } catch (IllegalArgumentException ex) { + // ref KYLIN-1967, real empty segment can trigger dictionary exception -- IllegalArgumentException: Value not exists! + if (cubeSeg.getInputRecords() == 0) { + logger.warn("cube segment {} input record is 0, skip it still", cubeSeg); + continue; + } + throw ex; + } scanners.add(scanner); }