You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2015/01/31 13:01:40 UTC
[13/50] incubator-kylin git commit: fix local test data for new
CubeDesc
fix local test data for new CubeDesc
Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/8058b14f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/8058b14f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/8058b14f
Branch: refs/heads/inverted-index
Commit: 8058b14fff96e72a41b81fdf285585e3e92b4ec9
Parents: 3211e3d
Author: Li, Yang <ya...@ebay.com>
Authored: Wed Jan 28 16:11:54 2015 +0800
Committer: Li, Yang <ya...@ebay.com>
Committed: Wed Jan 28 16:11:54 2015 +0800
----------------------------------------------------------------------
.../java/com/kylinolap/cube/model/CubeDesc.java | 2 +-
.../com/kylinolap/cube/model/RowKeyDesc.java | 12 ++++-----
.../com/kylinolap/cube/cuboid/CuboidTest.java | 2 +-
.../test_kylin_cube_with_slr_desc.json | 27 ++++++++++----------
...test_kylin_cube_with_slr_left_join_desc.json | 22 +++++++---------
.../test_kylin_cube_without_slr_desc.json | 27 ++++++++++----------
...t_kylin_cube_without_slr_left_join_desc.json | 27 ++++++++++----------
7 files changed, 59 insertions(+), 60 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/8058b14f/cube/src/main/java/com/kylinolap/cube/model/CubeDesc.java
----------------------------------------------------------------------
diff --git a/cube/src/main/java/com/kylinolap/cube/model/CubeDesc.java b/cube/src/main/java/com/kylinolap/cube/model/CubeDesc.java
index 8b3263f..219b167 100644
--- a/cube/src/main/java/com/kylinolap/cube/model/CubeDesc.java
+++ b/cube/src/main/java/com/kylinolap/cube/model/CubeDesc.java
@@ -427,7 +427,7 @@ public class CubeDesc extends RootPersistentEntity {
@Override
public String toString() {
- return "CubeDesc [name=" + name + ", factTable=" + getFactTable() + ", cubePartitionDesc=" + cubePartitionDesc + ", dimensions=" + dimensions + ", measures=" + measures + ", rowkey=" + rowkey + ", hbaseMapping=" + hbaseMapping + "]";
+ return "CubeDesc [name=" + name + "]";
}
public String calculateSignature() {
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/8058b14f/cube/src/main/java/com/kylinolap/cube/model/RowKeyDesc.java
----------------------------------------------------------------------
diff --git a/cube/src/main/java/com/kylinolap/cube/model/RowKeyDesc.java b/cube/src/main/java/com/kylinolap/cube/model/RowKeyDesc.java
index bed8034..9d09183 100644
--- a/cube/src/main/java/com/kylinolap/cube/model/RowKeyDesc.java
+++ b/cube/src/main/java/com/kylinolap/cube/model/RowKeyDesc.java
@@ -59,7 +59,7 @@ public class RowKeyDesc {
private String[][] aggregationGroups;
// computed content
- private CubeDesc cubeRef;
+ private CubeDesc cubeDesc;
private Map<TblColRef, RowKeyColDesc> columnMap;
private long fullMask;
@@ -106,11 +106,11 @@ public class RowKeyDesc {
}
public CubeDesc getCubeRef() {
- return cubeRef;
+ return cubeDesc;
}
public void setCubeRef(CubeDesc cubeRef) {
- this.cubeRef = cubeRef;
+ this.cubeDesc = cubeRef;
}
public long getFullMask() {
@@ -195,7 +195,7 @@ public class RowKeyDesc {
rowKeyColDesc.setBitIndex(rowkeyColumns.length - i - 1);
rowKeyColDesc.setColRef(colNameAbbr.get(column));
if (rowKeyColDesc.getColRef() == null) {
- throw new IllegalArgumentException("Cannot find rowkey column " + column + " in cube " + cubeRef);
+ throw new IllegalArgumentException("Cannot find rowkey column " + column + " in cube " + cubeDesc);
}
columnMap.put(rowKeyColDesc.getColRef(), rowKeyColDesc);
@@ -228,7 +228,7 @@ public class RowKeyDesc {
for (int j = 0; j < aggGrp.length; j++) {
TblColRef aggCol = colNameAbbr.get(aggGrp[j].toUpperCase());
if (aggCol == null) {
- throw new IllegalArgumentException("Can't find aggregation column " + aggGrp[j] + " in cube " + this.cubeRef.getName());
+ throw new IllegalArgumentException("Can't find aggregation column " + aggGrp[j] + " in cube " + this.cubeDesc.getName());
}
Integer index = getColumnBitIndex(aggCol);
mask.groupMask |= 1L << index;
@@ -262,7 +262,7 @@ public class RowKeyDesc {
private void buildHierarchyMasks() {
this.hierarchyMasks = new ArrayList<HierarchyMask>();
- for (DimensionDesc dimension : this.cubeRef.getDimensions()) {
+ for (DimensionDesc dimension : this.cubeDesc.getDimensions()) {
HierarchyDesc[] hierarchies = dimension.getHierarchy();
if (hierarchies == null || hierarchies.length == 0)
continue;
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/8058b14f/cube/src/test/java/com/kylinolap/cube/cuboid/CuboidTest.java
----------------------------------------------------------------------
diff --git a/cube/src/test/java/com/kylinolap/cube/cuboid/CuboidTest.java b/cube/src/test/java/com/kylinolap/cube/cuboid/CuboidTest.java
index 3d06e23..ba6d3f7 100644
--- a/cube/src/test/java/com/kylinolap/cube/cuboid/CuboidTest.java
+++ b/cube/src/test/java/com/kylinolap/cube/cuboid/CuboidTest.java
@@ -54,7 +54,7 @@ public class CuboidTest extends LocalFileMetadataTestCase {
@Before
public void setUp() throws Exception {
this.createTestMetadata();
- MetadataManager.removeInstance(this.getTestConfig());
+ MetadataManager.removeInstance(getTestConfig());
}
@After
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/8058b14f/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_with_slr_desc.json
----------------------------------------------------------------------
diff --git a/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_with_slr_desc.json b/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_with_slr_desc.json
index d152df3..6c4e5a0 100644
--- a/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_with_slr_desc.json
+++ b/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_with_slr_desc.json
@@ -12,17 +12,20 @@
{
"name": "cal_dt",
"table": "edw.test_cal_dt",
- "column": ["cal_dt"],
"derived": ["week_beg_dt"]
},
{
"name": "category",
"table": "default.test_category_groupings",
"column": ["meta_categ_name", "categ_lvl2_name", "categ_lvl3_name"],
- "derived": ["USER_DEFINED_FIELD1", "USER_DEFINED_FIELD3", "UPD_DATE", "UPD_USER"],
"hierarchy": true
},
{
+ "name": "category_derived",
+ "table": "default.test_category_groupings",
+ "derived": ["USER_DEFINED_FIELD1", "USER_DEFINED_FIELD3", "UPD_DATE", "UPD_USER"]
+ },
+ {
"name": "lstg_format_name",
"table": "default.test_kylin_fact",
"column": ["lstg_format_name"]
@@ -30,13 +33,11 @@
{
"name": "site_id",
"table": "edw.test_sites",
- "column": ["site_id"],
"derived": ["site_name", "cre_user"]
},
{
"name": "seller_type_cd",
"table": "edw.test_seller_type_dim",
- "column": ["seller_type_cd"],
"derived": ["seller_type_desc"]
},
{
@@ -97,15 +98,15 @@
],
"rowkey":{
"rowkey_columns": [
- { "column": "seller_id", "length": 18, "mandatory": "true" },
- { "column": "cal_dt", "dictionary": "date(yyyy-mm-dd)" },
- { "column": "leaf_categ_id", "dictionary": "string" },
- { "column": "meta_categ_name", "dictionary": "string" },
- { "column": "categ_lvl2_name", "dictionary": "string" },
- { "column": "categ_lvl3_name", "dictionary": "string" },
- { "column": "lstg_format_name", "length": 12 },
- { "column": "lstg_site_id", "dictionary": "string" },
- { "column": "slr_segment_cd", "dictionary": "string" }
+ { "column": "seller_id", "dictionary": "true", "mandatory": "true" },
+ { "column": "cal_dt", "dictionary": "true" },
+ { "column": "leaf_categ_id", "dictionary": "true" },
+ { "column": "meta_categ_name", "dictionary": "true" },
+ { "column": "categ_lvl2_name", "dictionary": "true" },
+ { "column": "categ_lvl3_name", "dictionary": "true" },
+ { "column": "lstg_format_name", "dictionary": "true" },
+ { "column": "lstg_site_id", "dictionary": "true" },
+ { "column": "slr_segment_cd", "dictionary": "true" }
],
"aggregation_groups": [
["leaf_categ_id","meta_categ_name","categ_lvl2_name","categ_lvl3_name","cal_dt"]
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/8058b14f/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_with_slr_left_join_desc.json
----------------------------------------------------------------------
diff --git a/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_with_slr_left_join_desc.json b/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_with_slr_left_join_desc.json
index b67ab38..5335580 100644
--- a/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_with_slr_left_join_desc.json
+++ b/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_with_slr_left_join_desc.json
@@ -12,7 +12,6 @@
{
"name": "cal_dt",
"table": "edw.test_cal_dt",
- "column": ["cal_dt"],
"derived": ["week_beg_dt"]
},
{
@@ -24,7 +23,6 @@
{
"name": "category_derived",
"table": "default.test_category_groupings",
- "column": ["leaf_categ_id", "site_id"],
"derived": ["USER_DEFINED_FIELD1", "USER_DEFINED_FIELD3", "UPD_DATE", "UPD_USER"]
},
{
@@ -35,13 +33,11 @@
{
"name": "site_id",
"table": "edw.test_sites",
- "column": ["site_id"],
"derived": ["site_name", "cre_user"]
},
{
"name": "seller_type_cd",
"table": "edw.test_seller_type_dim",
- "column": ["seller_type_cd"],
"derived": ["seller_type_desc"]
},
{
@@ -102,15 +98,15 @@
],
"rowkey":{
"rowkey_columns": [
- { "column": "seller_id", "length": 18, "mandatory": "true" },
- { "column": "cal_dt", "dictionary": "date(yyyy-mm-dd)" },
- { "column": "leaf_categ_id", "dictionary": "string" },
- { "column": "meta_categ_name", "dictionary": "string" },
- { "column": "categ_lvl2_name", "dictionary": "string" },
- { "column": "categ_lvl3_name", "dictionary": "string" },
- { "column": "lstg_format_name", "length": 12 },
- { "column": "lstg_site_id", "dictionary": "string" },
- { "column": "slr_segment_cd", "dictionary": "string" }
+ { "column": "seller_id", "dictionary": "true", "mandatory": "true" },
+ { "column": "cal_dt", "dictionary": "true" },
+ { "column": "leaf_categ_id", "dictionary": "true" },
+ { "column": "meta_categ_name", "dictionary": "true" },
+ { "column": "categ_lvl2_name", "dictionary": "true" },
+ { "column": "categ_lvl3_name", "dictionary": "true" },
+ { "column": "lstg_format_name", "dictionary": "true" },
+ { "column": "lstg_site_id", "dictionary": "true" },
+ { "column": "slr_segment_cd", "dictionary": "true" }
],
"aggregation_groups": [
["leaf_categ_id","meta_categ_name","categ_lvl2_name","categ_lvl3_name","cal_dt"]
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/8058b14f/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_without_slr_desc.json
----------------------------------------------------------------------
diff --git a/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_without_slr_desc.json b/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_without_slr_desc.json
index e109fbe..fd58dbd 100644
--- a/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_without_slr_desc.json
+++ b/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_without_slr_desc.json
@@ -13,7 +13,6 @@
{
"name": "cal_dt",
"table": "edw.test_cal_dt",
- "column": ["cal_dt"],
"derived": [
"week_beg_dt"
]
@@ -22,13 +21,17 @@
"name": "category",
"table": "default.test_category_groupings",
"column": ["meta_categ_name", "categ_lvl2_name", "categ_lvl3_name"],
+ "hierarchy": true
+ },
+ {
+ "name": "category_derived",
+ "table": "default.test_category_groupings",
"derived": [
"USER_DEFINED_FIELD1",
"USER_DEFINED_FIELD3",
"UPD_DATE",
"UPD_USER"
- ],
- "hierarchy": true
+ ]
},
{
"name": "lstg_format_name",
@@ -38,7 +41,6 @@
{
"name": "site_id",
"table": "edw.test_sites",
- "column": ["site_id"],
"derived": [
"site_name",
"cre_user"
@@ -47,7 +49,6 @@
{
"name": "seller_type_cd",
"table": "edw.test_seller_type_dim",
- "column": ["seller_type_cd"],
"derived": [
"seller_type_desc"
]
@@ -144,36 +145,36 @@
"rowkey_columns": [
{
"column": "cal_dt",
- "dictionary": "date(yyyy-mm-dd)",
+ "dictionary": "true",
"mandatory": "true"
},
{
"column": "leaf_categ_id",
- "dictionary": "string"
+ "dictionary": "true"
},
{
"column": "meta_categ_name",
- "dictionary": "string"
+ "dictionary": "true"
},
{
"column": "categ_lvl2_name",
- "dictionary": "string"
+ "dictionary": "true"
},
{
"column": "categ_lvl3_name",
- "dictionary": "string"
+ "dictionary": "true"
},
{
"column": "lstg_format_name",
- "length": 12
+ "dictionary": "true"
},
{
"column": "lstg_site_id",
- "dictionary": "string"
+ "dictionary": "true"
},
{
"column": "slr_segment_cd",
- "dictionary": "string"
+ "dictionary": "true"
}
],
"aggregation_groups": [
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/8058b14f/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_without_slr_left_join_desc.json
----------------------------------------------------------------------
diff --git a/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_without_slr_left_join_desc.json b/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_without_slr_left_join_desc.json
index 9ab5eed..0519dbc 100644
--- a/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_without_slr_left_join_desc.json
+++ b/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_without_slr_left_join_desc.json
@@ -11,7 +11,6 @@
{
"name": "cal_dt",
"table": "edw.test_cal_dt",
- "column": ["cal_dt"],
"derived": [
"week_beg_dt"
]
@@ -20,13 +19,17 @@
"name": "category",
"table": "default.test_category_groupings",
"column": ["meta_categ_name", "categ_lvl2_name", "categ_lvl3_name"],
+ "hierarchy": true
+ },
+ {
+ "name": "category_derived",
+ "table": "default.test_category_groupings",
"derived": [
"USER_DEFINED_FIELD1",
"USER_DEFINED_FIELD3",
"UPD_DATE",
"UPD_USER"
- ],
- "hierarchy": true
+ ]
},
{
"name": "lstg_format_name",
@@ -36,7 +39,6 @@
{
"name": "site_id",
"table": "edw.test_sites",
- "column": ["site_id"],
"derived": [
"site_name",
"cre_user"
@@ -45,7 +47,6 @@
{
"name": "seller_type_cd",
"table": "edw.test_seller_type_dim",
- "column": ["seller_type_cd"],
"derived": [
"seller_type_desc"
]
@@ -142,36 +143,36 @@
"rowkey_columns": [
{
"column": "cal_dt",
- "dictionary": "date(yyyy-mm-dd)",
+ "dictionary": "true",
"mandatory": "true"
},
{
"column": "leaf_categ_id",
- "dictionary": "string"
+ "dictionary": "true"
},
{
"column": "meta_categ_name",
- "dictionary": "string"
+ "dictionary": "true"
},
{
"column": "categ_lvl2_name",
- "dictionary": "string"
+ "dictionary": "true"
},
{
"column": "categ_lvl3_name",
- "dictionary": "string"
+ "dictionary": "true"
},
{
"column": "lstg_format_name",
- "dictionary": "string"
+ "dictionary": "true"
},
{
"column": "lstg_site_id",
- "dictionary": "string"
+ "dictionary": "true"
},
{
"column": "slr_segment_cd",
- "dictionary": "string"
+ "dictionary": "true"
}
],
"aggregation_groups": [