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 2015/06/29 13:05:07 UTC

incubator-kylin git commit: KYLIN-863 allow creation of a segment with empty data

Repository: incubator-kylin
Updated Branches:
  refs/heads/0.8 035642be6 -> 194f2df3f


KYLIN-863 allow creation of a segment with empty data


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/194f2df3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/194f2df3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/194f2df3

Branch: refs/heads/0.8
Commit: 194f2df3f0267a3aa4dec5569d47e9b0e607259d
Parents: 035642b
Author: shaofengshi <sh...@apache.org>
Authored: Mon Jun 29 19:01:13 2015 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Mon Jun 29 19:04:56 2015 +0800

----------------------------------------------------------------------
 .../cube/test_kylin_cube_with_slr_left_join_ready.json        | 7 ++++---
 .../cube/test_kylin_cube_with_slr_ready_2_segments.json       | 2 ++
 .../cube/test_kylin_cube_without_slr_left_join_ready.json     | 7 ++++---
 ...est_kylin_cube_without_slr_left_join_ready_2_segments.json | 1 +
 .../localmeta/cube/test_kylin_cube_without_slr_ready.json     | 7 ++++---
 .../kylin/job/inmemcubing/AbstractInMemCubeBuilder.java       | 4 ++--
 .../java/org/apache/kylin/storage/cube/CubeGridTable.java     | 3 ---
 7 files changed, 17 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/194f2df3/examples/test_case_data/localmeta/cube/test_kylin_cube_with_slr_left_join_ready.json
----------------------------------------------------------------------
diff --git a/examples/test_case_data/localmeta/cube/test_kylin_cube_with_slr_left_join_ready.json b/examples/test_case_data/localmeta/cube/test_kylin_cube_with_slr_left_join_ready.json
index 5f15336..7222161 100644
--- a/examples/test_case_data/localmeta/cube/test_kylin_cube_with_slr_left_join_ready.json
+++ b/examples/test_case_data/localmeta/cube/test_kylin_cube_with_slr_left_join_ready.json
@@ -7,10 +7,11 @@
   "descriptor" : "test_kylin_cube_with_slr_left_join_desc",
   "cost" : 50,
   "segments" : [ {
-	"name" : null,
+    "uuid" : "1eaca32a-a33e-4b69-83dd-xxe8b1f8dddd",
+	"name" : "1eaca32a-a33e-4b69-83dd-xxe8b1f8dddd",
 	"storage_location_identifier" : "KYLIN-CUBE-TEST_KYLIN_CUBE_WITH_SLR_LEFT_JOIN_READY-BCF2F125-9B0B-40DD-9509-95EC59B31333",
-	"date_range_start" : null,
-	"date_range_end" : null,
+    "date_range_start" : 0,
+    "date_range_end" : 1384243200000,
 	"status" : "READY",
 	"size_kb" : 7690,
 	"source_records" : 10000,

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/194f2df3/examples/test_case_data/localmeta/cube/test_kylin_cube_with_slr_ready_2_segments.json
----------------------------------------------------------------------
diff --git a/examples/test_case_data/localmeta/cube/test_kylin_cube_with_slr_ready_2_segments.json b/examples/test_case_data/localmeta/cube/test_kylin_cube_with_slr_ready_2_segments.json
index f4fb4a9..c36b164 100644
--- a/examples/test_case_data/localmeta/cube/test_kylin_cube_with_slr_ready_2_segments.json
+++ b/examples/test_case_data/localmeta/cube/test_kylin_cube_with_slr_ready_2_segments.json
@@ -7,6 +7,7 @@
   "descriptor" : "test_kylin_cube_with_slr_desc",
   "cost" : 50,
   "segments" : [ {
+    "uuid" : "1aeca32a-a33e-4b69-83dd-xxe8b1f8dddd",
     "name" : "19691231160000_20131112000000",
     "storage_location_identifier" : "KYLIN-CUBE-TEST_KYLIN_CUBE_WITH_SLR_READY-F24668F6-DCFF-4CB6-A89B-77F1119DF8FA",
     "date_range_start" : 1384240200000,
@@ -37,6 +38,7 @@
         "EDW.TEST_SITES" : "/table_snapshot/TEST_SITES.csv/28130338-fcf4-429e-91b0-cd8dfd397280.snapshot"
       }
   }, {
+    "uuid" : "2aeca32a-a33e-4b69-83dd-xxe8b1f8dddd",
     "name" : "20131112000000_20131212000000",
     "storage_location_identifier" : "KYLIN-CUBE-TEST_KYLIN_CUBE_WITH_SLR_READY-F24668F6-DCFF-4CB6-A89B-77F1119DF8FB",
     "date_range_start" : 1384243200000,

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/194f2df3/examples/test_case_data/localmeta/cube/test_kylin_cube_without_slr_left_join_ready.json
----------------------------------------------------------------------
diff --git a/examples/test_case_data/localmeta/cube/test_kylin_cube_without_slr_left_join_ready.json b/examples/test_case_data/localmeta/cube/test_kylin_cube_without_slr_left_join_ready.json
index d142700..f87dba7 100644
--- a/examples/test_case_data/localmeta/cube/test_kylin_cube_without_slr_left_join_ready.json
+++ b/examples/test_case_data/localmeta/cube/test_kylin_cube_without_slr_left_join_ready.json
@@ -7,10 +7,11 @@
   "descriptor" : "test_kylin_cube_without_slr_left_join_desc",
   "cost" : 10,
   "segments" : [ {
-    "name" : null,
+    "name" : "2accs32a-a33e-4b69-83dd-xxe8b1f8dddd",
+    "uuid" : "2accs32a-a33e-4b69-83dd-xxe8b1f8dddd",
     "storage_location_identifier" : "KYLIN-CUBE-TEST_KYLIN_CUBE_WITHOUT_SLR_LEFT_JOIN_READY-1EF30C45-17A4-4350-A032-A33B3B25E5B8",
-    "date_range_start" : null,
-    "date_range_end" : null,
+    "date_range_start" : 0,
+    "date_range_end" : 1384243200000,
     "status" : "READY",
     "size_kb" : 6060,
     "source_records" : 10000,

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/194f2df3/examples/test_case_data/localmeta/cube/test_kylin_cube_without_slr_left_join_ready_2_segments.json
----------------------------------------------------------------------
diff --git a/examples/test_case_data/localmeta/cube/test_kylin_cube_without_slr_left_join_ready_2_segments.json b/examples/test_case_data/localmeta/cube/test_kylin_cube_without_slr_left_join_ready_2_segments.json
index 0456e66..e241008 100644
--- a/examples/test_case_data/localmeta/cube/test_kylin_cube_without_slr_left_join_ready_2_segments.json
+++ b/examples/test_case_data/localmeta/cube/test_kylin_cube_without_slr_left_join_ready_2_segments.json
@@ -39,6 +39,7 @@
       }
   }, {
     "name" : "20131112000000_20131212000000",
+    "uuid" : "32f668f6-dcff-4cb6-a89b-77f1119df8fa",
     "storage_location_identifier" : "KYLIN-CUBE-TEST_KYLIN_CUBE_WITH_SLR_READY-F24668F6-DCFF-4CB6-A89B-77F1119DF8FB",
     "date_range_start" : 1384243200000,
     "date_range_end" : 1386835200000,

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/194f2df3/examples/test_case_data/localmeta/cube/test_kylin_cube_without_slr_ready.json
----------------------------------------------------------------------
diff --git a/examples/test_case_data/localmeta/cube/test_kylin_cube_without_slr_ready.json b/examples/test_case_data/localmeta/cube/test_kylin_cube_without_slr_ready.json
index 1995585..75ff690 100644
--- a/examples/test_case_data/localmeta/cube/test_kylin_cube_without_slr_ready.json
+++ b/examples/test_case_data/localmeta/cube/test_kylin_cube_without_slr_ready.json
@@ -7,10 +7,11 @@
   "descriptor" : "test_kylin_cube_without_slr_desc",
   "cost" : 10,
   "segments" : [ {
-    "name" : null,
+    "name" : "67f668f6-dcff-4cb6-a89b-77f1119df8fa",
+    "uuid" : "67f668f6-dcff-4cb6-a89b-77f1119df8fa",
     "storage_location_identifier" : "KYLIN-CUBE-TEST_KYLIN_CUBE_WITHOUT_SLR_READY-619D9B4A-DA56-48CA-9C58-29DC8323B200",
-    "date_range_start" : null,
-    "date_range_end" : null,
+    "date_range_start" : 0,
+    "date_range_end" : 1384243200000,
     "status" : "READY",
     "size_kb" : 5600,
     "source_records" : 10000,

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/194f2df3/job/src/main/java/org/apache/kylin/job/inmemcubing/AbstractInMemCubeBuilder.java
----------------------------------------------------------------------
diff --git a/job/src/main/java/org/apache/kylin/job/inmemcubing/AbstractInMemCubeBuilder.java b/job/src/main/java/org/apache/kylin/job/inmemcubing/AbstractInMemCubeBuilder.java
index 0ff7767..2a72064 100644
--- a/job/src/main/java/org/apache/kylin/job/inmemcubing/AbstractInMemCubeBuilder.java
+++ b/job/src/main/java/org/apache/kylin/job/inmemcubing/AbstractInMemCubeBuilder.java
@@ -47,8 +47,8 @@ abstract public class AbstractInMemCubeBuilder {
     public AbstractInMemCubeBuilder(CubeDesc cubeDesc, Map<TblColRef, Dictionary<?>> dictionaryMap) {
         if(cubeDesc == null)
             throw new NullPointerException();
-        if (dictionaryMap == null || dictionaryMap.isEmpty())
-            throw new IllegalArgumentException("dictionary cannot be empty");
+        if (dictionaryMap == null)
+            throw new IllegalArgumentException("dictionary cannot be null");
         
         this.cubeDesc = cubeDesc;
         this.dictionaryMap = dictionaryMap;

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/194f2df3/storage/src/main/java/org/apache/kylin/storage/cube/CubeGridTable.java
----------------------------------------------------------------------
diff --git a/storage/src/main/java/org/apache/kylin/storage/cube/CubeGridTable.java b/storage/src/main/java/org/apache/kylin/storage/cube/CubeGridTable.java
index 38ac965..f792402 100644
--- a/storage/src/main/java/org/apache/kylin/storage/cube/CubeGridTable.java
+++ b/storage/src/main/java/org/apache/kylin/storage/cube/CubeGridTable.java
@@ -48,9 +48,6 @@ public class CubeGridTable {
             int colIndex = mapping.getIndexOf(dim);
             if (cubeDesc.getRowkey().isUseDictionary(dim)) {
                 Dictionary dict = dictionaryMap.get(dim);
-                if (dict == null)
-                    throw new IllegalStateException();
-
                 dictionaryByColIdx.put(colIndex, dict);
             } else {
                 int len = cubeDesc.getRowkey().getColumnLength(dim);