Revert "remove unnecessary raw measure"
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/d7a3fdf5 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/d7a3fdf5 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/d7a3fdf5 Branch: refs/heads/KYLIN-1726 Commit: d7a3fdf57acb6fbabf94669aaca869e47d89aa13 Parents: a05f111 Author: Hongbin Ma <mahong...@apache.org> Authored: Sat Sep 10 14:40:25 2016 +0800 Committer: Hongbin Ma <mahong...@apache.org> Committed: Sat Sep 10 14:42:46 2016 +0800 ---------------------------------------------------------------------- .../kylin/measure/topn/TopNMeasureType.java | 2 + .../test_case_data/localmeta/cube_desc/ssb.json | 409 ++++++------- .../test_kylin_cube_with_slr_desc.json | 389 +++++------- ...st_kylin_cube_with_view_inner_join_desc.json | 388 +++++------- ...est_kylin_cube_with_view_left_join_desc.json | 388 +++++------- .../test_kylin_cube_without_slr_desc.json | 61 +- ...t_kylin_cube_without_slr_left_join_desc.json | 584 +++++++++---------- .../test_streaming_table_cube_desc.json | 245 ++++---- 8 files changed, 1048 insertions(+), 1418 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/d7a3fdf5/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNMeasureType.java ---------------------------------------------------------------------- diff --git a/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNMeasureType.java b/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNMeasureType.java index 0756056..01eb90c 100644 --- a/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNMeasureType.java +++ b/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNMeasureType.java @@ -274,9 +274,11 @@ public class TopNMeasureType extends MeasureType<TopNCounter<ByteArray>> { if (sum.isSum() == false) return false; + if (sum.getParameter() == null || sum.getParameter().getColRefs() == null || sum.getParameter().getColRefs().size() == 0) return false; + TblColRef sumCol = sum.getParameter().getColRefs().get(0); return sumCol.equals(topnNumCol); } http://git-wip-us.apache.org/repos/asf/kylin/blob/d7a3fdf5/examples/test_case_data/localmeta/cube_desc/ssb.json ---------------------------------------------------------------------- diff --git a/examples/test_case_data/localmeta/cube_desc/ssb.json b/examples/test_case_data/localmeta/cube_desc/ssb.json index 4903979..d3ea10b 100644 --- a/examples/test_case_data/localmeta/cube_desc/ssb.json +++ b/examples/test_case_data/localmeta/cube_desc/ssb.json @@ -1,256 +1,179 @@ { - "uuid": "5c44df30-daec-486e-af90-927bf7851057", - "name": "ssb", - "description": "", - "dimensions": [ - { - "name": "SSB.PART_DERIVED", - "table": "SSB.PART", - "column": null, - "derived": [ - "P_MFGR", - "P_CATEGORY", - "P_BRAND" - ] - }, - { - "name": "C_CITY", - "table": "SSB.CUSTOMER", - "column": "C_CITY", - "derived": null - }, - { - "name": "C_REGION", - "table": "SSB.CUSTOMER", - "column": "C_REGION", - "derived": null - }, - { - "name": "C_NATION", - "table": "SSB.CUSTOMER", - "column": "C_NATION", - "derived": null - }, - { - "name": "S_CITY", - "table": "SSB.SUPPLIER", - "column": "S_CITY", - "derived": null - }, - { - "name": "S_REGION", - "table": "SSB.SUPPLIER", - "column": "S_REGION", - "derived": null - }, - { - "name": "S_NATION", - "table": "SSB.SUPPLIER", - "column": "S_NATION", - "derived": null - }, - { - "name": "D_YEAR", - "table": "SSB.DATES", - "column": "D_YEAR", - "derived": null - }, - { - "name": "D_YEARMONTH", - "table": "SSB.DATES", - "column": "D_YEARMONTH", - "derived": null - }, - { - "name": "D_YEARMONTHNUM", - "table": "SSB.DATES", - "column": "D_YEARMONTHNUM", - "derived": null - }, - { - "name": "D_WEEKNUMINYEAR", - "table": "SSB.DATES", - "column": "D_WEEKNUMINYEAR", - "derived": null - } - ], - "measures": [ - { - "name": "_COUNT_", - "function": { - "expression": "COUNT", - "parameter": { - "type": "constant", - "value": "1", - "next_parameter": null - }, - "returntype": "bigint" + "uuid" : "5c44df30-daec-486e-af90-927bf7851057", + "name" : "ssb", + "description" : "", + "dimensions" : [ { + "name" : "SSB.PART_DERIVED", + "table" : "SSB.PART", + "column" : null, + "derived" : [ "P_MFGR", "P_CATEGORY", "P_BRAND" ] + }, { + "name" : "C_CITY", + "table" : "SSB.CUSTOMER", + "column" : "C_CITY", + "derived" : null + }, { + "name" : "C_REGION", + "table" : "SSB.CUSTOMER", + "column" : "C_REGION", + "derived" : null + }, { + "name" : "C_NATION", + "table" : "SSB.CUSTOMER", + "column" : "C_NATION", + "derived" : null + }, { + "name" : "S_CITY", + "table" : "SSB.SUPPLIER", + "column" : "S_CITY", + "derived" : null + }, { + "name" : "S_REGION", + "table" : "SSB.SUPPLIER", + "column" : "S_REGION", + "derived" : null + }, { + "name" : "S_NATION", + "table" : "SSB.SUPPLIER", + "column" : "S_NATION", + "derived" : null + }, { + "name" : "D_YEAR", + "table" : "SSB.DATES", + "column" : "D_YEAR", + "derived" : null + }, { + "name" : "D_YEARMONTH", + "table" : "SSB.DATES", + "column" : "D_YEARMONTH", + "derived" : null + }, { + "name" : "D_YEARMONTHNUM", + "table" : "SSB.DATES", + "column" : "D_YEARMONTHNUM", + "derived" : null + }, { + "name" : "D_WEEKNUMINYEAR", + "table" : "SSB.DATES", + "column" : "D_WEEKNUMINYEAR", + "derived" : null + } ], + "measures" : [ { + "name" : "_COUNT_", + "function" : { + "expression" : "COUNT", + "parameter" : { + "type" : "constant", + "value" : "1", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "bigint" }, - { - "name": "TOTAL_REVENUE", - "function": { - "expression": "SUM", - "parameter": { - "type": "column", - "value": "LO_REVENUE", - "next_parameter": null - }, - "returntype": "bigint" + "dependent_measure_ref" : null + }, { + "name" : "TOTAL_REVENUE", + "function" : { + "expression" : "SUM", + "parameter" : { + "type" : "column", + "value" : "LO_REVENUE", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "bigint" }, - { - "name": "TOTAL_SUPPLYCOST", - "function": { - "expression": "SUM", - "parameter": { - "type": "column", - "value": "LO_SUPPLYCOST", - "next_parameter": null - }, - "returntype": "bigint" + "dependent_measure_ref" : null + }, { + "name" : "TOTAL_SUPPLYCOST", + "function" : { + "expression" : "SUM", + "parameter" : { + "type" : "column", + "value" : "LO_SUPPLYCOST", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "bigint" }, - { - "name": "TOTAL_V_REVENUE", - "function": { - "expression": "SUM", - "parameter": { - "type": "column", - "value": "V_REVENUE", - "next_parameter": null - }, - "returntype": "bigint" + "dependent_measure_ref" : null + }, { + "name" : "TOTAL_V_REVENUE", + "function" : { + "expression" : "SUM", + "parameter" : { + "type" : "column", + "value" : "V_REVENUE", + "next_parameter" : null }, - "dependent_measure_ref": null - } - ], - "rowkey": { - "rowkey_columns": [ - { - "column": "LO_PARTKEY", - "encoding": "dict" - }, - { - "column": "C_CITY", - "encoding": "dict" - }, - { - "column": "C_REGION", - "encoding": "dict" - }, - { - "column": "C_NATION", - "encoding": "dict" - }, - { - "column": "S_CITY", - "encoding": "dict" - }, - { - "column": "S_REGION", - "encoding": "dict" - }, - { - "column": "S_NATION", - "encoding": "dict" - }, - { - "column": "D_YEAR", - "encoding": "dict" - }, - { - "column": "D_YEARMONTH", - "encoding": "dict" - }, - { - "column": "D_YEARMONTHNUM", - "encoding": "dict" - }, - { - "column": "D_WEEKNUMINYEAR", - "encoding": "dict" - } - ] + "returntype" : "bigint" + }, + "dependent_measure_ref" : null + } ], + "rowkey" : { + "rowkey_columns" : [ { + "column" : "LO_PARTKEY", + "encoding" : "dict" + }, { + "column" : "C_CITY", + "encoding" : "dict" + }, { + "column" : "C_REGION", + "encoding" : "dict" + }, { + "column" : "C_NATION", + "encoding" : "dict" + }, { + "column" : "S_CITY", + "encoding" : "dict" + }, { + "column" : "S_REGION", + "encoding" : "dict" + }, { + "column" : "S_NATION", + "encoding" : "dict" + }, { + "column" : "D_YEAR", + "encoding" : "dict" + }, { + "column" : "D_YEARMONTH", + "encoding" : "dict" + }, { + "column" : "D_YEARMONTHNUM", + "encoding" : "dict" + }, { + "column" : "D_WEEKNUMINYEAR", + "encoding" : "dict" + } ] }, - "signature": "5iV8LVYs+PmVUju8QNQ5TQ==", - "last_modified": 1457503036686, - "model_name": "ssb", - "null_string": null, - "hbase_mapping": { - "column_family": [ - { - "name": "F1", - "columns": [ - { - "qualifier": "M", - "measure_refs": [ - "_COUNT_", - "TOTAL_REVENUE", - "TOTAL_SUPPLYCOST", - "TOTAL_V_REVENUE" - ] - } - ] - } - ] + "signature" : "5iV8LVYs+PmVUju8QNQ5TQ==", + "last_modified" : 1457503036686, + "model_name" : "ssb", + "null_string" : null, + "hbase_mapping" : { + "column_family" : [ { + "name" : "F1", + "columns" : [ { + "qualifier" : "M", + "measure_refs" : [ "_COUNT_", "TOTAL_REVENUE", "TOTAL_SUPPLYCOST", "TOTAL_V_REVENUE" ] + } ] + } ] }, - "aggregation_groups": [ - { - "includes": [ - "LO_PARTKEY", - "C_CITY", - "C_REGION", - "C_NATION", - "S_CITY", - "S_REGION", - "S_NATION", - "D_YEAR", - "D_YEARMONTH", - "D_YEARMONTHNUM", - "D_WEEKNUMINYEAR" - ], - "select_rule": { - "hierarchy_dims": [ - [ - "C_REGION", - "C_NATION", - "C_CITY" - ], - [ - "S_REGION", - "S_NATION", - "S_CITY" - ], - [ - "D_YEARMONTH", - "D_YEARMONTHNUM", - "D_WEEKNUMINYEAR" - ] - ], - "mandatory_dims": [ - "D_YEAR" - ], - "joint_dims": [] - } + "aggregation_groups" : [ { + "includes" : [ "LO_PARTKEY", "C_CITY", "C_REGION", "C_NATION", "S_CITY", "S_REGION", "S_NATION", "D_YEAR", "D_YEARMONTH", "D_YEARMONTHNUM", "D_WEEKNUMINYEAR" ], + "select_rule" : { + "hierarchy_dims" : [ [ "C_REGION", "C_NATION", "C_CITY" ], [ "S_REGION", "S_NATION", "S_CITY" ], [ "D_YEARMONTH", "D_YEARMONTHNUM", "D_WEEKNUMINYEAR" ] ], + "mandatory_dims" : [ "D_YEAR" ], + "joint_dims" : [ ] } - ], - "notify_list": [], - "status_need_notify": [], - "partition_date_start": 694224000000, - "partition_date_end": 3153600000000, - "auto_merge_time_ranges": [ - 604800000, - 2419200000 - ], - "retention_range": 0, - "engine_type": 2, - "storage_type": 2, - "override_kylin_properties": { - "kylin.hbase.default.compression.codec": "lz4", - "kylin.cube.aggrgroup.isMandatoryOnlyValid": "true" + } ], + "notify_list" : [ ], + "status_need_notify" : [ ], + "partition_date_start" : 694224000000, + "partition_date_end" : 3153600000000, + "auto_merge_time_ranges" : [ 604800000, 2419200000 ], + "retention_range" : 0, + "engine_type" : 2, + "storage_type" : 2, + "override_kylin_properties" : { + "kylin.hbase.default.compression.codec" : "lz4", + "kylin.cube.aggrgroup.isMandatoryOnlyValid" : "true" } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/kylin/blob/d7a3fdf5/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 f62d196..4064fcb 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 @@ -1,245 +1,172 @@ { - "uuid": "a24ca905-1fc6-4f67-985c-38fa5aeafd92", - "name": "test_kylin_cube_with_slr_desc", - "description": null, - "dimensions": [ - { - "name": "CAL_DT", - "table": "EDW.TEST_CAL_DT", - "column": "{FK}", - "derived": [ - "WEEK_BEG_DT" - ] - }, - { - "name": "CATEGORY", - "table": "DEFAULT.TEST_CATEGORY_GROUPINGS", - "column": "{FK}", - "derived": [ - "USER_DEFINED_FIELD1", - "USER_DEFINED_FIELD3", - "UPD_DATE", - "UPD_USER" - ] - }, - { - "name": "CATEGORY_HIERARCHY", - "table": "DEFAULT.TEST_CATEGORY_GROUPINGS", - "column": "META_CATEG_NAME", - "derived": null - }, - { - "name": "CATEGORY_HIERARCHY", - "table": "DEFAULT.TEST_CATEGORY_GROUPINGS", - "column": "CATEG_LVL2_NAME", - "derived": null - }, - { - "name": "CATEGORY_HIERARCHY", - "table": "DEFAULT.TEST_CATEGORY_GROUPINGS", - "column": "CATEG_LVL3_NAME", - "derived": null - }, - { - "name": "LSTG_FORMAT_NAME", - "table": "DEFAULT.TEST_KYLIN_FACT", - "column": "LSTG_FORMAT_NAME", - "derived": null - }, - { - "name": "SITE_ID", - "table": "EDW.TEST_SITES", - "column": "{FK}", - "derived": [ - "SITE_NAME", - "CRE_USER" - ] - }, - { - "name": "SELLER_TYPE_CD", - "table": "EDW.TEST_SELLER_TYPE_DIM", - "column": "{FK}", - "derived": [ - "SELLER_TYPE_DESC" - ] - }, - { - "name": "SELLER_ID", - "table": "DEFAULT.TEST_KYLIN_FACT", - "column": "SELLER_ID", - "derived": null - } - ], - "measures": [ - { - "name": "GMV_SUM", - "function": { - "expression": "SUM", - "parameter": { - "type": "column", - "value": "PRICE", - "next_parameter": null - }, - "returntype": "decimal(19,4)" + "uuid" : "a24ca905-1fc6-4f67-985c-38fa5aeafd92", + + "name" : "test_kylin_cube_with_slr_desc", + "description" : null, + "dimensions" : [ { + "name" : "CAL_DT", + "table" : "EDW.TEST_CAL_DT", + "column" : "{FK}", + "derived" : [ "WEEK_BEG_DT" ] + }, { + "name" : "CATEGORY", + "table" : "DEFAULT.TEST_CATEGORY_GROUPINGS", + "column" : "{FK}", + "derived" : [ "USER_DEFINED_FIELD1", "USER_DEFINED_FIELD3", "UPD_DATE", "UPD_USER" ] + }, { + "name" : "CATEGORY_HIERARCHY", + "table" : "DEFAULT.TEST_CATEGORY_GROUPINGS", + "column" : "META_CATEG_NAME", + "derived" : null + }, { + "name" : "CATEGORY_HIERARCHY", + "table" : "DEFAULT.TEST_CATEGORY_GROUPINGS", + "column" : "CATEG_LVL2_NAME", + "derived" : null + }, { + "name" : "CATEGORY_HIERARCHY", + "table" : "DEFAULT.TEST_CATEGORY_GROUPINGS", + "column" : "CATEG_LVL3_NAME", + "derived" : null + }, { + "name" : "LSTG_FORMAT_NAME", + "table" : "DEFAULT.TEST_KYLIN_FACT", + "column" : "LSTG_FORMAT_NAME", + "derived" : null + }, { + "name" : "SITE_ID", + "table" : "EDW.TEST_SITES", + "column" : "{FK}", + "derived" : [ "SITE_NAME", "CRE_USER" ] + }, { + "name" : "SELLER_TYPE_CD", + "table" : "EDW.TEST_SELLER_TYPE_DIM", + "column" : "{FK}", + "derived" : [ "SELLER_TYPE_DESC" ] + }, { + "name" : "SELLER_ID", + "table" : "DEFAULT.TEST_KYLIN_FACT", + "column" : "SELLER_ID", + "derived" : null + } ], + "measures" : [ { + "name" : "GMV_SUM", + "function" : { + "expression" : "SUM", + "parameter" : { + "type" : "column", + "value" : "PRICE", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "decimal(19,4)" }, - { - "name": "GMV_MIN", - "function": { - "expression": "MIN", - "parameter": { - "type": "column", - "value": "PRICE", - "next_parameter": null - }, - "returntype": "decimal(19,4)" + "dependent_measure_ref" : null + }, { + "name" : "GMV_MIN", + "function" : { + "expression" : "MIN", + "parameter" : { + "type" : "column", + "value" : "PRICE", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "decimal(19,4)" }, - { - "name": "GMV_MAX", - "function": { - "expression": "MAX", - "parameter": { - "type": "column", - "value": "PRICE", - "next_parameter": null - }, - "returntype": "decimal(19,4)" + "dependent_measure_ref" : null + }, { + "name" : "GMV_MAX", + "function" : { + "expression" : "MAX", + "parameter" : { + "type" : "column", + "value" : "PRICE", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "decimal(19,4)" }, - { - "name": "TRANS_CNT", - "function": { - "expression": "COUNT", - "parameter": { - "type": "constant", - "value": "1", - "next_parameter": null - }, - "returntype": "bigint" + "dependent_measure_ref" : null + }, { + "name" : "TRANS_CNT", + "function" : { + "expression" : "COUNT", + "parameter" : { + "type" : "constant", + "value" : "1", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "bigint" }, - { - "name": "ITEM_COUNT_SUM", - "function": { - "expression": "SUM", - "parameter": { - "type": "column", - "value": "ITEM_COUNT", - "next_parameter": null - }, - "returntype": "bigint" + "dependent_measure_ref" : null + }, { + "name" : "ITEM_COUNT_SUM", + "function" : { + "expression" : "SUM", + "parameter" : { + "type" : "column", + "value" : "ITEM_COUNT", + "next_parameter" : null }, - "dependent_measure_ref": null - } - ], - "rowkey": { - "rowkey_columns": [ - { - "column": "seller_id", - "encoding": "int:4", - "isShardBy": true - }, - { - "column": "cal_dt", - "encoding": "dict" - }, - { - "column": "leaf_categ_id", - "encoding": "fixed_length:18" - }, - { - "column": "meta_categ_name", - "encoding": "dict" - }, - { - "column": "categ_lvl2_name", - "encoding": "dict" - }, - { - "column": "categ_lvl3_name", - "encoding": "dict" - }, - { - "column": "lstg_format_name", - "encoding": "fixed_length:12" - }, - { - "column": "lstg_site_id", - "encoding": "dict" - }, - { - "column": "slr_segment_cd", - "encoding": "dict" - } - ] + "returntype" : "bigint" + }, + "dependent_measure_ref" : null + } ], + "rowkey" : { + "rowkey_columns" : [ { + "column" : "seller_id", + "encoding" : "int:4", + "isShardBy" : true + }, { + "column" : "cal_dt", + "encoding" : "dict" + }, { + "column" : "leaf_categ_id", + "encoding" : "fixed_length:18" + }, { + "column" : "meta_categ_name", + "encoding" : "dict" + }, { + "column" : "categ_lvl2_name", + "encoding" : "dict" + }, { + "column" : "categ_lvl3_name", + "encoding" : "dict" + }, { + "column" : "lstg_format_name", + "encoding" : "fixed_length:12" + }, { + "column" : "lstg_site_id", + "encoding" : "dict" + }, { + "column" : "slr_segment_cd", + "encoding" : "dict" + } ] }, - "signature": null, - "last_modified": 1448959801271, - "model_name": "test_kylin_inner_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" - ] - } - ] - } - ] + "signature" : null, + "last_modified" : 1448959801271, + "model_name" : "test_kylin_inner_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" ] + } ] + } ] }, - "aggregation_groups": [ - { - "includes": [ - "cal_dt", - "categ_lvl2_name", - "categ_lvl3_name", - "leaf_categ_id", - "lstg_format_name", - "lstg_site_id", - "meta_categ_name", - "seller_id", - "slr_segment_cd" - ], - "select_rule": { - "hierarchy_dims": [ - [ - "META_CATEG_NAME", - "CATEG_LVL2_NAME", - "CATEG_LVL3_NAME" - ] - ], - "mandatory_dims": [ - "seller_id" - ], - "joint_dims": [ - [ - "lstg_format_name", - "lstg_site_id", - "slr_segment_cd" - ] - ] - } + "aggregation_groups" : [ { + "includes" : [ "cal_dt", "categ_lvl2_name", "categ_lvl3_name", "leaf_categ_id", "lstg_format_name", "lstg_site_id", "meta_categ_name", "seller_id", "slr_segment_cd" ], + "select_rule" : { + "hierarchy_dims" : [ [ "META_CATEG_NAME", "CATEG_LVL2_NAME", "CATEG_LVL3_NAME" ] ], + "mandatory_dims" : ["seller_id"], + "joint_dims" : [ [ "lstg_format_name", "lstg_site_id", "slr_segment_cd" ] ] } - ], - "notify_list": null, - "status_need_notify": [], - "auto_merge_time_ranges": null, - "retention_range": 0, - "engine_type": 2, - "storage_type": 2, - "partition_date_start": 0 + } ], + "notify_list" : null, + "status_need_notify" : [ ], + "auto_merge_time_ranges" : null, + "retention_range" : 0, + "engine_type" : 2, + "storage_type" : 2, + "partition_date_start" : 0 } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/kylin/blob/d7a3fdf5/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_with_view_inner_join_desc.json ---------------------------------------------------------------------- diff --git a/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_with_view_inner_join_desc.json b/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_with_view_inner_join_desc.json index e3a3e70..d4c64b5 100644 --- a/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_with_view_inner_join_desc.json +++ b/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_with_view_inner_join_desc.json @@ -1,249 +1,169 @@ { - "uuid": "9876b7a8-3929-4dff-b59d-2100aadc8dbf", - "name": "test_kylin_cube_with_view_inner_join_desc", - "description": null, - "dimensions": [ - { - "name": "CAL_DT", - "table": "EDW.V_TEST_CAL_DT", - "column": "{FK}", - "derived": [ - "WEEK_BEG_DT" - ] - }, - { - "name": "CATEGORY", - "table": "DEFAULT.TEST_CATEGORY_GROUPINGS", - "column": "{FK}", - "derived": [ - "USER_DEFINED_FIELD1", - "USER_DEFINED_FIELD3", - "UPD_DATE", - "UPD_USER" - ] - }, - { - "name": "CATEGORY_HIERARCHY", - "table": "DEFAULT.TEST_CATEGORY_GROUPINGS", - "column": "META_CATEG_NAME", - "derived": null - }, - { - "name": "CATEGORY_HIERARCHY", - "table": "DEFAULT.TEST_CATEGORY_GROUPINGS", - "column": "CATEG_LVL2_NAME", - "derived": null - }, - { - "name": "CATEGORY_HIERARCHY", - "table": "DEFAULT.TEST_CATEGORY_GROUPINGS", - "column": "CATEG_LVL3_NAME", - "derived": null - }, - { - "name": "LSTG_FORMAT_NAME", - "table": "DEFAULT.TEST_KYLIN_FACT", - "column": "LSTG_FORMAT_NAME", - "derived": null - }, - { - "name": "SITE_ID", - "table": "EDW.TEST_SITES", - "column": "{FK}", - "derived": [ - "SITE_NAME", - "CRE_USER" - ] - }, - { - "name": "SELLER_TYPE_CD", - "table": "EDW.TEST_SELLER_TYPE_DIM", - "column": "{FK}", - "derived": [ - "SELLER_TYPE_DESC" - ] - } - ], - "measures": [ - { - "name": "GMV_SUM", - "function": { - "expression": "SUM", - "parameter": { - "type": "column", - "value": "PRICE", - "next_parameter": null - }, - "returntype": "decimal(19,4)" + "uuid" : "9876b7a8-3929-4dff-b59d-2100aadc8dbf", + "name" : "test_kylin_cube_with_view_inner_join_desc", + "description" : null, + "dimensions" : [ { + "name" : "CAL_DT", + "table" : "EDW.V_TEST_CAL_DT", + "column" : "{FK}", + "derived" : [ "WEEK_BEG_DT" ] + }, { + "name" : "CATEGORY", + "table" : "DEFAULT.TEST_CATEGORY_GROUPINGS", + "column" : "{FK}", + "derived" : [ "USER_DEFINED_FIELD1", "USER_DEFINED_FIELD3", "UPD_DATE", "UPD_USER" ] + }, { + "name" : "CATEGORY_HIERARCHY", + "table" : "DEFAULT.TEST_CATEGORY_GROUPINGS", + "column" : "META_CATEG_NAME", + "derived" : null + }, { + "name" : "CATEGORY_HIERARCHY", + "table" : "DEFAULT.TEST_CATEGORY_GROUPINGS", + "column" : "CATEG_LVL2_NAME", + "derived" : null + }, { + "name" : "CATEGORY_HIERARCHY", + "table" : "DEFAULT.TEST_CATEGORY_GROUPINGS", + "column" : "CATEG_LVL3_NAME", + "derived" : null + }, { + "name" : "LSTG_FORMAT_NAME", + "table" : "DEFAULT.TEST_KYLIN_FACT", + "column" : "LSTG_FORMAT_NAME", + "derived" : null + }, { + "name" : "SITE_ID", + "table" : "EDW.TEST_SITES", + "column" : "{FK}", + "derived" : [ "SITE_NAME", "CRE_USER" ] + }, { + "name" : "SELLER_TYPE_CD", + "table" : "EDW.TEST_SELLER_TYPE_DIM", + "column" : "{FK}", + "derived" : [ "SELLER_TYPE_DESC" ] + } ], + "measures" : [ { + "name" : "GMV_SUM", + "function" : { + "expression" : "SUM", + "parameter" : { + "type" : "column", + "value" : "PRICE", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "decimal(19,4)" }, - { - "name": "GMV_MIN", - "function": { - "expression": "MIN", - "parameter": { - "type": "column", - "value": "PRICE", - "next_parameter": null - }, - "returntype": "decimal(19,4)" + "dependent_measure_ref" : null + }, { + "name" : "GMV_MIN", + "function" : { + "expression" : "MIN", + "parameter" : { + "type" : "column", + "value" : "PRICE", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "decimal(19,4)" }, - { - "name": "GMV_MAX", - "function": { - "expression": "MAX", - "parameter": { - "type": "column", - "value": "PRICE", - "next_parameter": null - }, - "returntype": "decimal(19,4)" + "dependent_measure_ref" : null + }, { + "name" : "GMV_MAX", + "function" : { + "expression" : "MAX", + "parameter" : { + "type" : "column", + "value" : "PRICE", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "decimal(19,4)" }, - { - "name": "TRANS_CNT", - "function": { - "expression": "COUNT", - "parameter": { - "type": "constant", - "value": "1", - "next_parameter": null - }, - "returntype": "bigint" + "dependent_measure_ref" : null + }, { + "name" : "TRANS_CNT", + "function" : { + "expression" : "COUNT", + "parameter" : { + "type" : "constant", + "value" : "1", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "bigint" }, - { - "name": "ITEM_COUNT_SUM", - "function": { - "expression": "SUM", - "parameter": { - "type": "column", - "value": "ITEM_COUNT", - "next_parameter": null - }, - "returntype": "bigint" - }, - "dependent_measure_ref": null - } - ], - "rowkey": { - "rowkey_columns": [ - { - "column": "cal_dt", - "encoding": "dict" + "dependent_measure_ref" : null + }, { + "name" : "ITEM_COUNT_SUM", + "function" : { + "expression" : "SUM", + "parameter" : { + "type" : "column", + "value" : "ITEM_COUNT", + "next_parameter" : null }, - { - "column": "leaf_categ_id", - "encoding": "dict" - }, - { - "column": "meta_categ_name", - "encoding": "dict" - }, - { - "column": "categ_lvl2_name", - "encoding": "dict" - }, - { - "column": "categ_lvl3_name", - "encoding": "dict" - }, - { - "column": "lstg_format_name", - "encoding": "dict" - }, - { - "column": "lstg_site_id", - "encoding": "dict" - }, - { - "column": "slr_segment_cd", - "encoding": "dict" - } - ] + "returntype" : "bigint" + }, + "dependent_measure_ref" : null + }], + "rowkey" : { + "rowkey_columns" : [ { + "column" : "cal_dt", + "encoding" : "dict" + }, { + "column" : "leaf_categ_id", + "encoding" : "dict" + }, { + "column" : "meta_categ_name", + "encoding" : "dict" + }, { + "column" : "categ_lvl2_name", + "encoding" : "dict" + }, { + "column" : "categ_lvl3_name", + "encoding" : "dict" + }, { + "column" : "lstg_format_name", + "encoding" : "dict" + }, { + "column" : "lstg_site_id", + "encoding" : "dict" + }, { + "column" : "slr_segment_cd", + "encoding" : "dict" + } ] }, - "signature": null, - "last_modified": 1448959801311, - "model_name": "test_kylin_inner_join_view_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" - ] - } - ] - } - ] + "signature" : null, + "last_modified" : 1448959801311, + "model_name" : "test_kylin_inner_join_view_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" ] + } ] + }] }, - "aggregation_groups": [ - { - "includes": [ - "cal_dt", - "categ_lvl2_name", - "categ_lvl3_name", - "leaf_categ_id", - "lstg_format_name", - "lstg_site_id", - "meta_categ_name" - ], - "select_rule": { - "hierarchy_dims": [], - "mandatory_dims": [ - "cal_dt" - ], - "joint_dims": [ - [ - "categ_lvl2_name", - "categ_lvl3_name", - "leaf_categ_id", - "meta_categ_name" - ] - ] - } - }, - { - "includes": [ - "cal_dt", - "categ_lvl2_name", - "categ_lvl3_name", - "leaf_categ_id", - "meta_categ_name" - ], - "select_rule": { - "hierarchy_dims": [ - [ - "META_CATEG_NAME", - "CATEG_LVL2_NAME", - "CATEG_LVL3_NAME" - ] - ], - "mandatory_dims": [ - "cal_dt" - ], - "joint_dims": [] - } + "aggregation_groups" : [ { + "includes" : [ "cal_dt", "categ_lvl2_name", "categ_lvl3_name", "leaf_categ_id", "lstg_format_name", "lstg_site_id", "meta_categ_name"], + "select_rule" : { + "hierarchy_dims" : [ ], + "mandatory_dims" : [ "cal_dt" ], + "joint_dims" : [ [ "categ_lvl2_name", "categ_lvl3_name", "leaf_categ_id", "meta_categ_name" ] ] + } + }, { + "includes" : [ "cal_dt", "categ_lvl2_name", "categ_lvl3_name", "leaf_categ_id", "meta_categ_name" ], + "select_rule" : { + "hierarchy_dims" : [ [ "META_CATEG_NAME", "CATEG_LVL2_NAME", "CATEG_LVL3_NAME" ] ], + "mandatory_dims" : [ "cal_dt" ], + "joint_dims" : [ ] } - ], - "notify_list": null, - "status_need_notify": [], - "auto_merge_time_ranges": null, - "retention_range": 0, - "engine_type": 2, - "storage_type": 2, + } ], + "notify_list" : null, + "status_need_notify" : [ ], + "auto_merge_time_ranges" : null, + "retention_range" : 0, + "engine_type" : 2, + "storage_type" : 2, "partition_date_start": 0 } http://git-wip-us.apache.org/repos/asf/kylin/blob/d7a3fdf5/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_with_view_left_join_desc.json ---------------------------------------------------------------------- diff --git a/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_with_view_left_join_desc.json b/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_with_view_left_join_desc.json index b17fbff..0388c0e 100644 --- a/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_with_view_left_join_desc.json +++ b/examples/test_case_data/localmeta/cube_desc/test_kylin_cube_with_view_left_join_desc.json @@ -1,249 +1,169 @@ { - "uuid": "6789b7a8-3929-4dff-b59d-2100aadc8dbf", - "name": "test_kylin_cube_with_view_left_join_desc", - "description": null, - "dimensions": [ - { - "name": "CAL_DT", - "table": "EDW.V_TEST_CAL_DT", - "column": "{FK}", - "derived": [ - "WEEK_BEG_DT" - ] - }, - { - "name": "CATEGORY", - "table": "DEFAULT.TEST_CATEGORY_GROUPINGS", - "column": "{FK}", - "derived": [ - "USER_DEFINED_FIELD1", - "USER_DEFINED_FIELD3", - "UPD_DATE", - "UPD_USER" - ] - }, - { - "name": "CATEGORY_HIERARCHY", - "table": "DEFAULT.TEST_CATEGORY_GROUPINGS", - "column": "META_CATEG_NAME", - "derived": null - }, - { - "name": "CATEGORY_HIERARCHY", - "table": "DEFAULT.TEST_CATEGORY_GROUPINGS", - "column": "CATEG_LVL2_NAME", - "derived": null - }, - { - "name": "CATEGORY_HIERARCHY", - "table": "DEFAULT.TEST_CATEGORY_GROUPINGS", - "column": "CATEG_LVL3_NAME", - "derived": null - }, - { - "name": "LSTG_FORMAT_NAME", - "table": "DEFAULT.TEST_KYLIN_FACT", - "column": "LSTG_FORMAT_NAME", - "derived": null - }, - { - "name": "SITE_ID", - "table": "EDW.TEST_SITES", - "column": "{FK}", - "derived": [ - "SITE_NAME", - "CRE_USER" - ] - }, - { - "name": "SELLER_TYPE_CD", - "table": "EDW.TEST_SELLER_TYPE_DIM", - "column": "{FK}", - "derived": [ - "SELLER_TYPE_DESC" - ] - } - ], - "measures": [ - { - "name": "GMV_SUM", - "function": { - "expression": "SUM", - "parameter": { - "type": "column", - "value": "PRICE", - "next_parameter": null - }, - "returntype": "decimal(19,4)" + "uuid" : "6789b7a8-3929-4dff-b59d-2100aadc8dbf", + "name" : "test_kylin_cube_with_view_left_join_desc", + "description" : null, + "dimensions" : [ { + "name" : "CAL_DT", + "table" : "EDW.V_TEST_CAL_DT", + "column" : "{FK}", + "derived" : [ "WEEK_BEG_DT" ] + }, { + "name" : "CATEGORY", + "table" : "DEFAULT.TEST_CATEGORY_GROUPINGS", + "column" : "{FK}", + "derived" : [ "USER_DEFINED_FIELD1", "USER_DEFINED_FIELD3", "UPD_DATE", "UPD_USER" ] + }, { + "name" : "CATEGORY_HIERARCHY", + "table" : "DEFAULT.TEST_CATEGORY_GROUPINGS", + "column" : "META_CATEG_NAME", + "derived" : null + }, { + "name" : "CATEGORY_HIERARCHY", + "table" : "DEFAULT.TEST_CATEGORY_GROUPINGS", + "column" : "CATEG_LVL2_NAME", + "derived" : null + }, { + "name" : "CATEGORY_HIERARCHY", + "table" : "DEFAULT.TEST_CATEGORY_GROUPINGS", + "column" : "CATEG_LVL3_NAME", + "derived" : null + }, { + "name" : "LSTG_FORMAT_NAME", + "table" : "DEFAULT.TEST_KYLIN_FACT", + "column" : "LSTG_FORMAT_NAME", + "derived" : null + }, { + "name" : "SITE_ID", + "table" : "EDW.TEST_SITES", + "column" : "{FK}", + "derived" : [ "SITE_NAME", "CRE_USER" ] + }, { + "name" : "SELLER_TYPE_CD", + "table" : "EDW.TEST_SELLER_TYPE_DIM", + "column" : "{FK}", + "derived" : [ "SELLER_TYPE_DESC" ] + } ], + "measures" : [ { + "name" : "GMV_SUM", + "function" : { + "expression" : "SUM", + "parameter" : { + "type" : "column", + "value" : "PRICE", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "decimal(19,4)" }, - { - "name": "GMV_MIN", - "function": { - "expression": "MIN", - "parameter": { - "type": "column", - "value": "PRICE", - "next_parameter": null - }, - "returntype": "decimal(19,4)" + "dependent_measure_ref" : null + }, { + "name" : "GMV_MIN", + "function" : { + "expression" : "MIN", + "parameter" : { + "type" : "column", + "value" : "PRICE", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "decimal(19,4)" }, - { - "name": "GMV_MAX", - "function": { - "expression": "MAX", - "parameter": { - "type": "column", - "value": "PRICE", - "next_parameter": null - }, - "returntype": "decimal(19,4)" + "dependent_measure_ref" : null + }, { + "name" : "GMV_MAX", + "function" : { + "expression" : "MAX", + "parameter" : { + "type" : "column", + "value" : "PRICE", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "decimal(19,4)" }, - { - "name": "TRANS_CNT", - "function": { - "expression": "COUNT", - "parameter": { - "type": "constant", - "value": "1", - "next_parameter": null - }, - "returntype": "bigint" + "dependent_measure_ref" : null + }, { + "name" : "TRANS_CNT", + "function" : { + "expression" : "COUNT", + "parameter" : { + "type" : "constant", + "value" : "1", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "bigint" }, - { - "name": "ITEM_COUNT_SUM", - "function": { - "expression": "SUM", - "parameter": { - "type": "column", - "value": "ITEM_COUNT", - "next_parameter": null - }, - "returntype": "bigint" - }, - "dependent_measure_ref": null - } - ], - "rowkey": { - "rowkey_columns": [ - { - "column": "cal_dt", - "encoding": "dict" + "dependent_measure_ref" : null + }, { + "name" : "ITEM_COUNT_SUM", + "function" : { + "expression" : "SUM", + "parameter" : { + "type" : "column", + "value" : "ITEM_COUNT", + "next_parameter" : null }, - { - "column": "leaf_categ_id", - "encoding": "dict" - }, - { - "column": "meta_categ_name", - "encoding": "dict" - }, - { - "column": "categ_lvl2_name", - "encoding": "dict" - }, - { - "column": "categ_lvl3_name", - "encoding": "dict" - }, - { - "column": "lstg_format_name", - "encoding": "dict" - }, - { - "column": "lstg_site_id", - "encoding": "dict" - }, - { - "column": "slr_segment_cd", - "encoding": "dict" - } - ] + "returntype" : "bigint" + }, + "dependent_measure_ref" : null + }], + "rowkey" : { + "rowkey_columns" : [ { + "column" : "cal_dt", + "encoding" : "dict" + }, { + "column" : "leaf_categ_id", + "encoding" : "dict" + }, { + "column" : "meta_categ_name", + "encoding" : "dict" + }, { + "column" : "categ_lvl2_name", + "encoding" : "dict" + }, { + "column" : "categ_lvl3_name", + "encoding" : "dict" + }, { + "column" : "lstg_format_name", + "encoding" : "dict" + }, { + "column" : "lstg_site_id", + "encoding" : "dict" + }, { + "column" : "slr_segment_cd", + "encoding" : "dict" + } ] }, - "signature": null, - "last_modified": 1448959801311, - "model_name": "test_kylin_left_join_view_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" - ] - } - ] - } - ] + "signature" : null, + "last_modified" : 1448959801311, + "model_name" : "test_kylin_left_join_view_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" ] + } ] + }] }, - "aggregation_groups": [ - { - "includes": [ - "cal_dt", - "categ_lvl2_name", - "categ_lvl3_name", - "leaf_categ_id", - "lstg_format_name", - "lstg_site_id", - "meta_categ_name" - ], - "select_rule": { - "hierarchy_dims": [], - "mandatory_dims": [ - "cal_dt" - ], - "joint_dims": [ - [ - "categ_lvl2_name", - "categ_lvl3_name", - "leaf_categ_id", - "meta_categ_name" - ] - ] - } - }, - { - "includes": [ - "cal_dt", - "categ_lvl2_name", - "categ_lvl3_name", - "leaf_categ_id", - "meta_categ_name" - ], - "select_rule": { - "hierarchy_dims": [ - [ - "META_CATEG_NAME", - "CATEG_LVL2_NAME", - "CATEG_LVL3_NAME" - ] - ], - "mandatory_dims": [ - "cal_dt" - ], - "joint_dims": [] - } + "aggregation_groups" : [ { + "includes" : [ "cal_dt", "categ_lvl2_name", "categ_lvl3_name", "leaf_categ_id", "lstg_format_name", "lstg_site_id", "meta_categ_name"], + "select_rule" : { + "hierarchy_dims" : [ ], + "mandatory_dims" : [ "cal_dt" ], + "joint_dims" : [ [ "categ_lvl2_name", "categ_lvl3_name", "leaf_categ_id", "meta_categ_name" ] ] + } + }, { + "includes" : [ "cal_dt", "categ_lvl2_name", "categ_lvl3_name", "leaf_categ_id", "meta_categ_name" ], + "select_rule" : { + "hierarchy_dims" : [ [ "META_CATEG_NAME", "CATEG_LVL2_NAME", "CATEG_LVL3_NAME" ] ], + "mandatory_dims" : [ "cal_dt" ], + "joint_dims" : [ ] } - ], - "notify_list": null, - "status_need_notify": [], - "auto_merge_time_ranges": null, - "retention_range": 0, - "engine_type": 2, - "storage_type": 2, + } ], + "notify_list" : null, + "status_need_notify" : [ ], + "auto_merge_time_ranges" : null, + "retention_range" : 0, + "engine_type" : 2, + "storage_type" : 2, "partition_date_start": 0 } http://git-wip-us.apache.org/repos/asf/kylin/blob/d7a3fdf5/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 d185175..28328e4 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 @@ -1,4 +1,5 @@ { + "uuid": "9ac9b7a8-3929-4dff-b59d-2100aadc8dbf", "name": "test_kylin_cube_without_slr_desc", "description": null, @@ -159,19 +160,54 @@ "returntype": "extendedcolumn(100)" }, "dependent_measure_ref": null - }, - { - "name": "PRICE_RAW", - "function": { - "expression": "RAW", - "parameter": { - "type": "column", - "value": "PRICE", - "next_parameter": null + }, { + "name" : "CAL_DT_RAW", + "function" : { + "expression" : "RAW", + "parameter" : { + "type" : "column", + "value" : "CAL_DT", + "next_parameter" : null }, - "returntype": "raw" + "returntype" : "raw" }, - "dependent_measure_ref": null + "dependent_measure_ref" : null + }, { + "name" : "LSTG_FORMAT_NAME_RAW", + "function" : { + "expression" : "RAW", + "parameter" : { + "type" : "column", + "value" : "LSTG_FORMAT_NAME", + "next_parameter" : null + }, + "returntype" : "raw" + }, + "dependent_measure_ref" : null + }, { + "name" : "LEAF_CATEG_ID_RAW", + "function" : { + "expression" : "RAW", + "parameter" : { + "type" : "column", + "value" : "LEAF_CATEG_ID", + "next_parameter" : null + }, + "returntype" : "raw" + }, + "dependent_measure_ref" : null + }, { + "name" : "PRICE_RAW", + "function" : { + "expression" : "RAW", + "parameter" : { + "type" : "column", + "value" : "PRICE", + "next_parameter" : null + }, + "returntype" : "raw" + }, + "dependent_measure_ref" : null } ], "rowkey": { @@ -234,6 +270,9 @@ "item_count_sum", "SITE_EXTENDED_1", "SITE_EXTENDED_2", + "CAL_DT_RAW", + "LSTG_FORMAT_NAME_RAW", + "LEAF_CATEG_ID_RAW", "PRICE_RAW" ] } http://git-wip-us.apache.org/repos/asf/kylin/blob/d7a3fdf5/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 2aea1a8..ca1b35c 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 @@ -1,357 +1,293 @@ { - "uuid": "9ac9b7a8-3929-4dff-b59d-2100aadc8dbf", - "name": "test_kylin_cube_without_slr_left_join_desc", - "description": null, - "dimensions": [ - { - "name": "CAL_DT", - "table": "EDW.TEST_CAL_DT", - "column": "{FK}", - "derived": [ - "WEEK_BEG_DT" - ] - }, - { - "name": "CATEGORY", - "table": "DEFAULT.TEST_CATEGORY_GROUPINGS", - "column": "{FK}", - "derived": [ - "USER_DEFINED_FIELD1", - "USER_DEFINED_FIELD3", - "UPD_DATE", - "UPD_USER" - ] - }, - { - "name": "CATEGORY_HIERARCHY", - "table": "DEFAULT.TEST_CATEGORY_GROUPINGS", - "column": "META_CATEG_NAME", - "derived": null - }, - { - "name": "CATEGORY_HIERARCHY", - "table": "DEFAULT.TEST_CATEGORY_GROUPINGS", - "column": "CATEG_LVL2_NAME", - "derived": null - }, - { - "name": "CATEGORY_HIERARCHY", - "table": "DEFAULT.TEST_CATEGORY_GROUPINGS", - "column": "CATEG_LVL3_NAME", - "derived": null + "uuid" : "9ac9b7a8-3929-4dff-b59d-2100aadc8dbf", + "name" : "test_kylin_cube_without_slr_left_join_desc", + "description" : null, + "dimensions" : [ { + "name" : "CAL_DT", + "table" : "EDW.TEST_CAL_DT", + "column" : "{FK}", + "derived" : [ "WEEK_BEG_DT" ] + }, { + "name" : "CATEGORY", + "table" : "DEFAULT.TEST_CATEGORY_GROUPINGS", + "column" : "{FK}", + "derived" : [ "USER_DEFINED_FIELD1", "USER_DEFINED_FIELD3", "UPD_DATE", "UPD_USER" ] + }, { + "name" : "CATEGORY_HIERARCHY", + "table" : "DEFAULT.TEST_CATEGORY_GROUPINGS", + "column" : "META_CATEG_NAME", + "derived" : null + }, { + "name" : "CATEGORY_HIERARCHY", + "table" : "DEFAULT.TEST_CATEGORY_GROUPINGS", + "column" : "CATEG_LVL2_NAME", + "derived" : null + }, { + "name" : "CATEGORY_HIERARCHY", + "table" : "DEFAULT.TEST_CATEGORY_GROUPINGS", + "column" : "CATEG_LVL3_NAME", + "derived" : null + }, { + "name" : "LSTG_FORMAT_NAME", + "table" : "DEFAULT.TEST_KYLIN_FACT", + "column" : "LSTG_FORMAT_NAME", + "derived" : null + }, { + "name" : "SITE_ID", + "table" : "EDW.TEST_SITES", + "column" : "{FK}", + "derived" : [ "SITE_NAME", "CRE_USER" ] + }, { + "name" : "SELLER_TYPE_CD", + "table" : "EDW.TEST_SELLER_TYPE_DIM", + "column" : "{FK}", + "derived" : [ "SELLER_TYPE_DESC" ] + } ], + "measures" : [ { + "name" : "GMV_SUM", + "function" : { + "expression" : "SUM", + "parameter" : { + "type" : "column", + "value" : "PRICE", + "next_parameter" : null + }, + "returntype" : "decimal(19,4)" }, - { - "name": "LSTG_FORMAT_NAME", - "table": "DEFAULT.TEST_KYLIN_FACT", - "column": "LSTG_FORMAT_NAME", - "derived": null + "dependent_measure_ref" : null + }, { + "name" : "GMV_MIN", + "function" : { + "expression" : "MIN", + "parameter" : { + "type" : "column", + "value" : "PRICE", + "next_parameter" : null + }, + "returntype" : "decimal(19,4)" }, - { - "name": "SITE_ID", - "table": "EDW.TEST_SITES", - "column": "{FK}", - "derived": [ - "SITE_NAME", - "CRE_USER" - ] + "dependent_measure_ref" : null + }, { + "name" : "GMV_MAX", + "function" : { + "expression" : "MAX", + "parameter" : { + "type" : "column", + "value" : "PRICE", + "next_parameter" : null + }, + "returntype" : "decimal(19,4)" }, - { - "name": "SELLER_TYPE_CD", - "table": "EDW.TEST_SELLER_TYPE_DIM", - "column": "{FK}", - "derived": [ - "SELLER_TYPE_DESC" - ] - } - ], - "measures": [ - { - "name": "GMV_SUM", - "function": { - "expression": "SUM", - "parameter": { - "type": "column", - "value": "PRICE", - "next_parameter": null - }, - "returntype": "decimal(19,4)" + "dependent_measure_ref" : null + }, { + "name" : "TRANS_CNT", + "function" : { + "expression" : "COUNT", + "parameter" : { + "type" : "constant", + "value" : "1", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "bigint" }, - { - "name": "GMV_MIN", - "function": { - "expression": "MIN", - "parameter": { - "type": "column", - "value": "PRICE", - "next_parameter": null - }, - "returntype": "decimal(19,4)" + "dependent_measure_ref" : null + }, { + "name" : "ITEM_COUNT_SUM", + "function" : { + "expression" : "SUM", + "parameter" : { + "type" : "column", + "value" : "ITEM_COUNT", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "bigint" }, - { - "name": "GMV_MAX", - "function": { - "expression": "MAX", - "parameter": { - "type": "column", - "value": "PRICE", - "next_parameter": null - }, - "returntype": "decimal(19,4)" + "dependent_measure_ref" : null + }, { + "name" : "SELLER_CNT_BITMAP", + "function" : { + "expression" : "COUNT_DISTINCT", + "parameter" : { + "type" : "column", + "value" : "SELLER_ID", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "bitmap" }, - { - "name": "TRANS_CNT", - "function": { - "expression": "COUNT", - "parameter": { - "type": "constant", - "value": "1", - "next_parameter": null - }, - "returntype": "bigint" + "dependent_measure_ref" : null + }, { + "name" : "SITE_NAME_BITMAP", + "function" : { + "expression" : "COUNT_DISTINCT", + "parameter" : { + "type" : "column", + "value" : "SITE_NAME", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "bitmap" }, - { - "name": "ITEM_COUNT_SUM", - "function": { - "expression": "SUM", - "parameter": { - "type": "column", - "value": "ITEM_COUNT", - "next_parameter": null - }, - "returntype": "bigint" + "dependent_measure_ref" : null + }, { + "name" : "SELLER_FORMAT_CNT", + "function" : { + "expression" : "COUNT_DISTINCT", + "parameter" : { + "type" : "column", + "value" : "LSTG_FORMAT_NAME", + "next_parameter" : { + "type" : "column", + "value" : "SELLER_ID", + "next_parameter" : null + } }, - "dependent_measure_ref": null + "returntype" : "hllc(10)" }, - { - "name": "SELLER_CNT_BITMAP", - "function": { - "expression": "COUNT_DISTINCT", - "parameter": { - "type": "column", - "value": "SELLER_ID", - "next_parameter": null - }, - "returntype": "bitmap" + "dependent_measure_ref" : null + }, { + "name" : "TOP_SELLER", + "function" : { + "expression" : "TOP_N", + "parameter" : { + "type" : "column", + "value" : "PRICE", + "next_parameter" : { + "type" : "column", + "value" : "SELLER_ID", + "next_parameter" : null + } }, - "dependent_measure_ref": null + "returntype" : "topn(100)", + "configuration": {"topn.encoding.SELLER_ID" : "int:4"} }, - { - "name": "SITE_NAME_BITMAP", - "function": { - "expression": "COUNT_DISTINCT", - "parameter": { - "type": "column", - "value": "SITE_NAME", - "next_parameter": null - }, - "returntype": "bitmap" + "dependent_measure_ref" : null + }, { + "name" : "CAL_DT_RAW", + "function" : { + "expression" : "RAW", + "parameter" : { + "type" : "column", + "value" : "CAL_DT", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "raw" }, - { - "name": "SELLER_FORMAT_CNT", - "function": { - "expression": "COUNT_DISTINCT", - "parameter": { - "type": "column", - "value": "LSTG_FORMAT_NAME", - "next_parameter": { - "type": "column", - "value": "SELLER_ID", - "next_parameter": null - } - }, - "returntype": "hllc(10)" + "dependent_measure_ref" : null + }, { + "name" : "LSTG_FORMAT_NAME_RAW", + "function" : { + "expression" : "RAW", + "parameter" : { + "type" : "column", + "value" : "LSTG_FORMAT_NAME", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "raw" }, - { - "name": "TOP_SELLER", - "function": { - "expression": "TOP_N", - "parameter": { - "type": "column", - "value": "PRICE", - "next_parameter": { - "type": "column", - "value": "SELLER_ID", - "next_parameter": null - } - }, - "returntype": "topn(100)", - "configuration": { - "topn.encoding.SELLER_ID": "int:4" - } + "dependent_measure_ref" : null + }, { + "name" : "LEAF_CATEG_ID_RAW", + "function" : { + "expression" : "RAW", + "parameter" : { + "type" : "column", + "value" : "LEAF_CATEG_ID", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "raw" }, - { - "name": "PRICE_RAW", - "function": { - "expression": "RAW", - "parameter": { - "type": "column", - "value": "PRICE", - "next_parameter": null - }, - "returntype": "raw" + "dependent_measure_ref" : null + }, { + "name" : "PRICE_RAW", + "function" : { + "expression" : "RAW", + "parameter" : { + "type" : "column", + "value" : "PRICE", + "next_parameter" : null }, - "dependent_measure_ref": null - } - ], - "dictionaries": [ + "returntype" : "raw" + }, + "dependent_measure_ref" : null + } ], + "dictionaries" : [ { - "column": "SITE_NAME", + "column" : "SITE_NAME", "builder": "org.apache.kylin.dict.GlobalDictionaryBuilder" } ], - "rowkey": { - "rowkey_columns": [ - { - "column": "cal_dt", - "encoding": "dict" - }, - { - "column": "leaf_categ_id", - "encoding": "dict" - }, - { - "column": "meta_categ_name", - "encoding": "dict" - }, - { - "column": "categ_lvl2_name", - "encoding": "dict" - }, - { - "column": "categ_lvl3_name", - "encoding": "dict" - }, - { - "column": "lstg_format_name", - "encoding": "dict" - }, - { - "column": "lstg_site_id", - "encoding": "dict" - }, - { - "column": "slr_segment_cd", - "encoding": "dict" - } - ] + "rowkey" : { + "rowkey_columns" : [ { + "column" : "cal_dt", + "encoding" : "dict" + }, { + "column" : "leaf_categ_id", + "encoding" : "dict" + }, { + "column" : "meta_categ_name", + "encoding" : "dict" + }, { + "column" : "categ_lvl2_name", + "encoding" : "dict" + }, { + "column" : "categ_lvl3_name", + "encoding" : "dict" + }, { + "column" : "lstg_format_name", + "encoding" : "dict" + }, { + "column" : "lstg_site_id", + "encoding" : "dict" + }, { + "column" : "slr_segment_cd", + "encoding" : "dict" + } ] }, - "signature": null, - "last_modified": 1448959801311, - "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", - "PRICE_RAW" - ] - } - ] - }, - { - "name": "f2", - "columns": [ - { - "qualifier": "m", - "measure_refs": [ - "seller_cnt_bitmap", - "site_name_bitmap", - "seller_format_cnt" - ] - } - ] - }, - { - "name": "f3", - "columns": [ - { - "qualifier": "m", - "measure_refs": [ - "top_seller" - ] - } - ] - } - ] + "signature" : null, + "last_modified" : 1448959801311, + "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", "CAL_DT_RAW", "LSTG_FORMAT_NAME_RAW", "LEAF_CATEG_ID_RAW", "PRICE_RAW" ] + } ] + }, { + "name" : "f2", + "columns" : [ { + "qualifier" : "m", + "measure_refs" : [ "seller_cnt_bitmap", "site_name_bitmap", "seller_format_cnt"] + } ] + }, { + "name" : "f3", + "columns" : [ { + "qualifier" : "m", + "measure_refs" : [ "top_seller" ] + } ] + } ] }, - "aggregation_groups": [ - { - "includes": [ - "cal_dt", - "categ_lvl2_name", - "categ_lvl3_name", - "leaf_categ_id", - "lstg_format_name", - "lstg_site_id", - "meta_categ_name" - ], - "select_rule": { - "hierarchy_dims": [], - "mandatory_dims": [ - "cal_dt" - ], - "joint_dims": [ - [ - "categ_lvl2_name", - "categ_lvl3_name", - "leaf_categ_id", - "meta_categ_name" - ] - ] - } - }, - { - "includes": [ - "cal_dt", - "categ_lvl2_name", - "categ_lvl3_name", - "leaf_categ_id", - "meta_categ_name" - ], - "select_rule": { - "hierarchy_dims": [ - [ - "META_CATEG_NAME", - "CATEG_LVL2_NAME", - "CATEG_LVL3_NAME" - ] - ], - "mandatory_dims": [ - "cal_dt" - ], - "joint_dims": [] - } + "aggregation_groups" : [ { + "includes" : [ "cal_dt", "categ_lvl2_name", "categ_lvl3_name", "leaf_categ_id", "lstg_format_name", "lstg_site_id", "meta_categ_name"], + "select_rule" : { + "hierarchy_dims" : [ ], + "mandatory_dims" : [ "cal_dt" ], + "joint_dims" : [ [ "categ_lvl2_name", "categ_lvl3_name", "leaf_categ_id", "meta_categ_name" ] ] } - ], - "notify_list": null, - "status_need_notify": [], - "auto_merge_time_ranges": null, - "retention_range": 0, - "engine_type": 2, - "storage_type": 2, + }, { + "includes" : [ "cal_dt", "categ_lvl2_name", "categ_lvl3_name", "leaf_categ_id", "meta_categ_name" ], + "select_rule" : { + "hierarchy_dims" : [ [ "META_CATEG_NAME", "CATEG_LVL2_NAME", "CATEG_LVL3_NAME" ] ], + "mandatory_dims" : [ "cal_dt" ], + "joint_dims" : [ ] + } + } ], + "notify_list" : null, + "status_need_notify" : [ ], + "auto_merge_time_ranges" : null, + "retention_range" : 0, + "engine_type" : 2, + "storage_type" : 2, "override_kylin_properties": { "kylin.job.cubing.inmem.sampling.hll.precision": "16" }, http://git-wip-us.apache.org/repos/asf/kylin/blob/d7a3fdf5/examples/test_case_data/localmeta/cube_desc/test_streaming_table_cube_desc.json ---------------------------------------------------------------------- diff --git a/examples/test_case_data/localmeta/cube_desc/test_streaming_table_cube_desc.json b/examples/test_case_data/localmeta/cube_desc/test_streaming_table_cube_desc.json index f2c4e72..ef10c1e 100644 --- a/examples/test_case_data/localmeta/cube_desc/test_streaming_table_cube_desc.json +++ b/examples/test_case_data/localmeta/cube_desc/test_streaming_table_cube_desc.json @@ -1,155 +1,118 @@ { - "uuid": "901ed15e-7769-4c66-b7ae-fbdc971cd192", - "name": "test_streaming_table_cube_desc", - "description": "", - "dimensions": [ - { - "name": "DEFAULT.STREAMING_TABLE.SITE", - "table": "DEFAULT.STREAMING_TABLE", - "column": "SITE", - "derived": null - }, - { - "name": "DEFAULT.STREAMING_TABLE.ITM", - "table": "DEFAULT.STREAMING_TABLE", - "column": "ITM", - "derived": null - }, - { - "name": "TIME", - "table": "DEFAULT.STREAMING_TABLE", - "column": "DAY_START", - "derived": null - }, - { - "name": "TIME", - "table": "DEFAULT.STREAMING_TABLE", - "column": "HOUR_START", - "derived": null - }, - { - "name": "TIME", - "table": "DEFAULT.STREAMING_TABLE", - "column": "MINUTE_START", - "derived": null - } - ], - "measures": [ - { - "name": "_COUNT_", - "function": { - "expression": "COUNT", - "parameter": { - "type": "constant", - "value": "1", - "next_parameter": null - }, - "returntype": "bigint" + "uuid" : "901ed15e-7769-4c66-b7ae-fbdc971cd192", + + "name" : "test_streaming_table_cube_desc", + "description" : "", + "dimensions" : [ { + "name" : "DEFAULT.STREAMING_TABLE.SITE", + "table" : "DEFAULT.STREAMING_TABLE", + "column" : "SITE", + "derived" : null + }, { + "name" : "DEFAULT.STREAMING_TABLE.ITM", + "table" : "DEFAULT.STREAMING_TABLE", + "column" : "ITM", + "derived" : null + }, { + "name" : "TIME", + "table" : "DEFAULT.STREAMING_TABLE", + "column" : "DAY_START", + "derived" : null + }, { + "name" : "TIME", + "table" : "DEFAULT.STREAMING_TABLE", + "column" : "HOUR_START", + "derived" : null + }, { + "name" : "TIME", + "table" : "DEFAULT.STREAMING_TABLE", + "column" : "MINUTE_START", + "derived" : null + } ], + "measures" : [ { + "name" : "_COUNT_", + "function" : { + "expression" : "COUNT", + "parameter" : { + "type" : "constant", + "value" : "1", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "bigint" }, - { - "name": "GMV_SUM", - "function": { - "expression": "SUM", - "parameter": { - "type": "column", - "value": "GMV", - "next_parameter": null - }, - "returntype": "decimal(19,6)" + "dependent_measure_ref" : null + }, { + "name" : "GMV_SUM", + "function" : { + "expression" : "SUM", + "parameter" : { + "type" : "column", + "value" : "GMV", + "next_parameter" : null }, - "dependent_measure_ref": null + "returntype" : "decimal(19,6)" }, - { - "name": "ITEM_COUNT_SUM", - "function": { - "expression": "SUM", - "parameter": { - "type": "column", - "value": "ITEM_COUNT", - "next_parameter": null - }, - "returntype": "bigint" + "dependent_measure_ref" : null + }, { + "name" : "ITEM_COUNT_SUM", + "function" : { + "expression" : "SUM", + "parameter" : { + "type" : "column", + "value" : "ITEM_COUNT", + "next_parameter" : null }, - "dependent_measure_ref": null - } - ], - "rowkey": { - "rowkey_columns": [ - { - "column": "DAY_START", - "encoding": "dict" - }, - { - "column": "HOUR_START", - "encoding": "dict" - }, - { - "column": "MINUTE_START", - "encoding": "dict" - }, - { - "column": "SITE", - "encoding": "dict" - }, - { - "column": "ITM", - "encoding": "dict" - } - ] + "returntype" : "bigint" + }, + "dependent_measure_ref" : null + } ], + "rowkey" : { + "rowkey_columns" : [ { + "column" : "DAY_START", + "encoding" : "dict" + }, { + "column" : "HOUR_START", + "encoding" : "dict" + }, { + "column" : "MINUTE_START", + "encoding" : "dict" + }, { + "column" : "SITE", + "encoding" : "dict" + }, { + "column" : "ITM", + "encoding" : "dict" + } ] }, - "signature": null, - "last_modified": 1448959801314, - "model_name": "test_streaming_table_model_desc", - "null_string": null, - "hbase_mapping": { - "column_family": [ - { - "name": "F1", - "columns": [ - { - "qualifier": "M", - "measure_refs": [ - "_COUNT_", - "GMV_SUM", - "ITEM_COUNT_SUM" - ] - } - ] - } - ] + "signature" : null, + "last_modified" : 1448959801314, + "model_name" : "test_streaming_table_model_desc", + "null_string" : null, + "hbase_mapping" : { + "column_family" : [ { + "name" : "F1", + "columns" : [ { + "qualifier" : "M", + "measure_refs" : [ "_COUNT_", "GMV_SUM", "ITEM_COUNT_SUM" ] + } ] + } ] }, - "aggregation_groups": [ - { - "includes": [ - "DAY_START", - "HOUR_START", - "ITM", - "MINUTE_START", - "SITE" - ], - "select_rule": { - "hierarchy_dims": [ - [ - "DAY_START", - "HOUR_START", - "MINUTE_START" - ] - ], - "mandatory_dims": [], - "joint_dims": [] - } + "aggregation_groups" : [ { + "includes" : [ "DAY_START", "HOUR_START", "ITM", "MINUTE_START", "SITE" ], + "select_rule" : { + "hierarchy_dims" : [ [ "DAY_START", "HOUR_START", "MINUTE_START" ] ], + "mandatory_dims" : [ ], + "joint_dims" : [ ] } - ], + } ], "override_kylin_properties": { "kylin.cube.algorithm": "inmem" }, - "notify_list": [], - "status_need_notify": [], - "auto_merge_time_ranges": null, - "retention_range": 0, - "engine_type": 2, - "storage_type": 2, + "notify_list" : [ ], + "status_need_notify" : [ ], + "auto_merge_time_ranges" : null, + "retention_range" : 0, + "engine_type" : 2, + "storage_type" : 2, "partition_date_start": 0 } \ No newline at end of file