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/09/28 10:55:49 UTC
incubator-kylin git commit: KYLIN-943 add two test cubes for topN
Repository: incubator-kylin
Updated Branches:
refs/heads/KYLIN-943 e0a0080db -> baab99f98
KYLIN-943 add two test cubes for topN
Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/baab99f9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/baab99f9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/baab99f9
Branch: refs/heads/KYLIN-943
Commit: baab99f9897cb1f672dba5d74682947be49ebd49
Parents: e0a0080
Author: shaofengshi <sh...@apache.org>
Authored: Mon Sep 28 16:54:36 2015 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Mon Sep 28 16:55:26 2015 +0800
----------------------------------------------------------------------
.../kylin/job/BuildCubeWithEngineTest.java | 32 +++-
.../cube/test_kylin_cube_topn_left_join.json | 10 ++
.../cube_desc/test_kylin_cube_topn_desc.json | 2 +-
.../test_kylin_cube_topn_left_join_desc.json | 147 +++++++++++++++++++
.../test_kylin_cube_without_slr_desc.json | 25 ----
...t_kylin_cube_without_slr_left_join_desc.json | 25 ----
.../localmeta/project/default.json | 10 ++
7 files changed, 198 insertions(+), 53 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/baab99f9/assembly/src/test/java/org/apache/kylin/job/BuildCubeWithEngineTest.java
----------------------------------------------------------------------
diff --git a/assembly/src/test/java/org/apache/kylin/job/BuildCubeWithEngineTest.java b/assembly/src/test/java/org/apache/kylin/job/BuildCubeWithEngineTest.java
index 5aa108d..8a81165 100644
--- a/assembly/src/test/java/org/apache/kylin/job/BuildCubeWithEngineTest.java
+++ b/assembly/src/test/java/org/apache/kylin/job/BuildCubeWithEngineTest.java
@@ -128,12 +128,12 @@ public class BuildCubeWithEngineTest {
}
private void testInner() throws Exception {
- String[] testCase = new String[] { "testInnerJoinCube", "testInnerJoinCube2"};
+ String[] testCase = new String[] { "testInnerJoinCube", "testInnerJoinCube2", "testInnerJoinCube3"};
runTestAndAssertSucceed(testCase);
}
private void testLeft() throws Exception {
- String[] testCase = new String[] { "testLeftJoinCube", "testLeftJoinCube2" };
+ String[] testCase = new String[] { "testLeftJoinCube", "testLeftJoinCube2", "testLeftJoinCube3" };
runTestAndAssertSucceed(testCase);
}
@@ -188,6 +188,20 @@ public class BuildCubeWithEngineTest {
@SuppressWarnings("unused")
// called by reflection
+ private List<String> testInnerJoinCube3() throws Exception {
+ clearSegment("test_kylin_cube_topn");
+ SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");
+ f.setTimeZone(TimeZone.getTimeZone("GMT"));
+ long date1 = 0;
+ long date2 = f.parse("2022-01-01").getTime();
+ List<String> result = Lists.newArrayList();
+ result.add(buildSegment("test_kylin_cube_with_slr_empty", date1, date2));
+ return result;
+ }
+
+
+ @SuppressWarnings("unused")
+ // called by reflection
private List<String> testInnerJoinCube2() throws Exception {
clearSegment("test_kylin_cube_with_slr_empty");
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");
@@ -222,6 +236,20 @@ public class BuildCubeWithEngineTest {
@SuppressWarnings("unused")
// called by reflection
+ private List<String> testLeftJoinCube3() throws Exception {
+ clearSegment("test_kylin_cube_topn_left_join");
+ SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");
+ f.setTimeZone(TimeZone.getTimeZone("GMT"));
+ long date1 = 0;
+ long date2 = f.parse("2022-01-01").getTime();
+ List<String> result = Lists.newArrayList();
+ result.add(buildSegment("test_kylin_cube_topn_left_join", date1, date2));
+ return result;
+ }
+
+
+ @SuppressWarnings("unused")
+ // called by reflection
private List<String> testLeftJoinCube2() throws Exception {
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");
f.setTimeZone(TimeZone.getTimeZone("GMT"));
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/baab99f9/examples/test_case_data/localmeta/cube/test_kylin_cube_topn_left_join.json
----------------------------------------------------------------------
diff --git a/examples/test_case_data/localmeta/cube/test_kylin_cube_topn_left_join.json b/examples/test_case_data/localmeta/cube/test_kylin_cube_topn_left_join.json
new file mode 100644
index 0000000..6f57561
--- /dev/null
+++ b/examples/test_case_data/localmeta/cube/test_kylin_cube_topn_left_join.json
@@ -0,0 +1,10 @@
+{
+ "uuid" : "44454455-a33e-4b69-83dd-0bb8b1f8c53b",
+ "last_modified" : 0,
+ "name" : "test_kylin_cube_topn_left_join",
+ "owner" : null,
+ "version" : null,
+ "descriptor" : "test_kylin_cube_topn_left_join_desc",
+ "segments" : [ ],
+ "create_time" : null
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/baab99f9/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_topn_desc.json
----------------------------------------------------------------------
diff --git a/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_topn_desc.json b/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_topn_desc.json
index 7c2c6ff..17a3fdc 100644
--- a/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_topn_desc.json
+++ b/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_topn_desc.json
@@ -112,7 +112,7 @@
]
},
"last_modified": 1422435345330,
- "model_name": "test_kylin_left_join_model_desc",
+ "model_name": "test_kylin_inner_join_model_desc",
"null_string": null,
"hbase_mapping": {
"column_family": [
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/baab99f9/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_topn_left_join_desc.json
----------------------------------------------------------------------
diff --git a/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_topn_left_join_desc.json b/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_topn_left_join_desc.json
new file mode 100644
index 0000000..893ebcd
--- /dev/null
+++ b/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_topn_left_join_desc.json
@@ -0,0 +1,147 @@
+{
+ "uuid": "5445a905-1fc6-4f67-985c-38fa5aeafd92",
+ "name": "test_kylin_cube_topn_left_join_desc",
+ "description": null,
+ "engine_type": 2,
+ "dimensions": [
+ {
+ "id": 0,
+ "name": "CAL_DT",
+ "table": "EDW.TEST_CAL_DT",
+ "column": null,
+ "derived": [
+ "WEEK_BEG_DT"
+ ],
+ "hierarchy": false
+ }
+ ],
+ "measures": [
+ {
+ "id": 1,
+ "name": "GMV_SUM",
+ "function": {
+ "expression": "SUM",
+ "parameter": {
+ "type": "column",
+ "value": "PRICE"
+ },
+ "returntype": "decimal(19,4)"
+ },
+ "dependent_measure_ref": null
+ },
+ {
+ "id": 2,
+ "name": "GMV_MIN",
+ "function": {
+ "expression": "MIN",
+ "parameter": {
+ "type": "column",
+ "value": "PRICE"
+ },
+ "returntype": "decimal(19,4)"
+ },
+ "dependent_measure_ref": null
+ },
+ {
+ "id": 3,
+ "name": "GMV_MAX",
+ "function": {
+ "expression": "MAX",
+ "parameter": {
+ "type": "column",
+ "value": "PRICE"
+ },
+ "returntype": "decimal(19,4)"
+ },
+ "dependent_measure_ref": null
+ },
+ {
+ "id": 4,
+ "name": "TRANS_CNT",
+ "function": {
+ "expression": "COUNT",
+ "parameter": {
+ "type": "constant",
+ "value": "1"
+ },
+ "returntype": "bigint"
+ },
+ "dependent_measure_ref": null
+ },
+ {
+ "id": 5,
+ "name": "ITEM_COUNT_SUM",
+ "function": {
+ "expression": "SUM",
+ "parameter": {
+ "type": "column",
+ "value": "ITEM_COUNT"
+ },
+ "returntype": "bigint"
+ },
+ "dependent_measure_ref": null
+ },
+ {
+ "id": 6,
+ "name": "TOP_SELLER",
+ "function": {
+ "expression": "TOP_N",
+ "parameter": {
+ "type": "column",
+ "value": "PRICE",
+ "displaycolumn": "seller_id"
+ },
+ "returntype": "topn(100)"
+ },
+ "dependent_measure_ref": null
+ }
+ ],
+ "rowkey": {
+ "rowkey_columns": [
+ {
+ "column": "cal_dt",
+ "length": 0,
+ "dictionary": "true",
+ "mandatory": false
+ }
+ ],
+ "aggregation_groups": [
+ [
+ "cal_dt"
+ ]
+ ]
+ },
+ "last_modified": 1422435345330,
+ "model_name": "test_kylin_left_join_model_desc",
+ "null_string": null,
+ "hbase_mapping": {
+ "column_family": [
+ {
+ "name": "f1",
+ "columns": [
+ {
+ "qualifier": "m",
+ "measure_refs": [
+ "gmv_sum",
+ "gmv_min",
+ "gmv_max",
+ "trans_cnt",
+ "item_count_sum"
+ ]
+ }
+ ]
+ }, {
+ "name": "f2",
+ "columns": [
+ {
+ "qualifier": "m",
+ "measure_refs": [
+ "top_seller"
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "notify_list": null
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/baab99f9/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 5a7bc83..76675f5 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
@@ -162,20 +162,6 @@
"returntype": "hllc(10)"
},
"dependent_measure_ref": null
- },
- {
- "id": 8,
- "name": "TOP_SELLER",
- "function": {
- "expression": "TOP_N",
- "parameter": {
- "type": "column",
- "value": "PRICE",
- "displaycolumn": "seller_id"
- },
- "returntype": "topn(20)"
- },
- "dependent_measure_ref": null
}
],
"rowkey": {
@@ -275,17 +261,6 @@
]
}
]
- },
- {
- "name": "f3",
- "columns": [
- {
- "qualifier": "m",
- "measure_refs": [
- "top_seller"
- ]
- }
- ]
}
]
},
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/baab99f9/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 266ede5..d3be1c9 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
@@ -162,20 +162,6 @@
"returntype": "hllc(10)"
},
"dependent_measure_ref": null
- },
- {
- "id": 8,
- "name": "TOP_SELLER",
- "function": {
- "expression": "TOP_N",
- "parameter": {
- "type": "column",
- "value": "PRICE",
- "displaycolumn": "seller_id"
- },
- "returntype": "topn(20)"
- },
- "dependent_measure_ref": null
}
],
"rowkey": {
@@ -275,17 +261,6 @@
]
}
]
- },
- {
- "name": "f3",
- "columns": [
- {
- "qualifier": "m",
- "measure_refs": [
- "top_seller"
- ]
- }
- ]
}
]
},
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/baab99f9/examples/test_case_data/localmeta/project/default.json
----------------------------------------------------------------------
diff --git a/examples/test_case_data/localmeta/project/default.json b/examples/test_case_data/localmeta/project/default.json
index e4118ca..ac6fdb5 100644
--- a/examples/test_case_data/localmeta/project/default.json
+++ b/examples/test_case_data/localmeta/project/default.json
@@ -46,6 +46,16 @@
"name": "test_kylin_hybrid_inner_join",
"type": "HYBRID",
"realization": "test_kylin_hybrid_inner_join"
+ },
+ {
+ "name": "test_kylin_cube_topn",
+ "type": "CUBE",
+ "realization": "test_kylin_cube_topn"
+ },
+ {
+ "name": "test_kylin_cube_topn_left_join",
+ "type": "CUBE",
+ "realization": "test_kylin_cube_topn_left_join"
}
]
}
\ No newline at end of file