Repository: kylin Updated Branches: refs/heads/yang22 76999735f -> ee47f8572
http://git-wip-us.apache.org/repos/asf/kylin/blob/ee47f857/examples/sample_cube/template/cube_desc/kylin_sales_cube.json ---------------------------------------------------------------------- diff --git a/examples/sample_cube/template/cube_desc/kylin_sales_cube.json b/examples/sample_cube/template/cube_desc/kylin_sales_cube.json index 48eef46..eb17922 100644 --- a/examples/sample_cube/template/cube_desc/kylin_sales_cube.json +++ b/examples/sample_cube/template/cube_desc/kylin_sales_cube.json @@ -6,32 +6,27 @@ "description" : null, "null_string" : null, "dimensions" : [ { - "name" : "TRANS_ID", - "table" : "DEFAULT.KYLIN_SALES", - "column" : "TRANS_ID", - "derived" : null - }, { "name" : "CAL_DT", "table" : "DEFAULT.KYLIN_CAL_DT", "column" : "{FK}", - "derived" : [ "WEEK_BEG_DT", "MONTH_BEG_DT", "YEAR_BEG_DT" ] + "derived" : [ "WEEK_BEG_DT" ] }, { "name" : "CATEGORY", "table" : "DEFAULT.KYLIN_CATEGORY_GROUPINGS", "column" : "{FK}", "derived" : [ "USER_DEFINED_FIELD1", "USER_DEFINED_FIELD3" ] }, { - "name" : "META_CATEG_NAME", + "name" : "CATEGORY_HIERARCHY", "table" : "DEFAULT.KYLIN_CATEGORY_GROUPINGS", "column" : "META_CATEG_NAME", "derived" : null }, { - "name" : "CATEG_LVL2_NAME", + "name" : "CATEGORY_HIERARCHY", "table" : "DEFAULT.KYLIN_CATEGORY_GROUPINGS", "column" : "CATEG_LVL2_NAME", "derived" : null }, { - "name" : "CATEG_LVL3_NAME", + "name" : "CATEGORY_HIERARCHY", "table" : "DEFAULT.KYLIN_CATEGORY_GROUPINGS", "column" : "CATEG_LVL3_NAME", "derived" : null @@ -41,54 +36,14 @@ "column" : "LSTG_FORMAT_NAME", "derived" : null }, { - "name" : "SELLER_ID", + "name" : "USER_ID", "table" : "DEFAULT.KYLIN_SALES", - "column" : "SELLER_ID", + "column" : "USER_ID", "derived" : null }, { - "name" : "BUYER_ID", + "name" : "REGION", "table" : "DEFAULT.KYLIN_SALES", - "column" : "BUYER_ID", - "derived" : null - }, { - "name" : "ACCOUNT_BUYER_LEVEL", - "table" : "BUYER_ACCOUNT", - "column" : "ACCOUNT_BUYER_LEVEL", - "derived" : null - }, { - "name" : "ACCOUNT_SELLER_LEVEL", - "table" : "SELLER_ACCOUNT", - "column" : "ACCOUNT_SELLER_LEVEL", - "derived" : null - }, { - "name" : "BUYER_COUNTRY", - "table" : "BUYER_ACCOUNT", - "column" : "ACCOUNT_COUNTRY", - "derived" : null - }, { - "name" : "SELLER_COUNTRY", - "table" : "SELLER_ACCOUNT", - "column" : "ACCOUNT_COUNTRY", - "derived" : null - }, { - "name" : "BUYER_COUNTRY_NAME", - "table" : "BUYER_COUNTRY", - "column" : "NAME", - "derived" : null - }, { - "name" : "SELLER_COUNTRY_NAME", - "table" : "SELLER_COUNTRY", - "column" : "NAME", - "derived" : null - }, { - "name" : "OPS_USER_ID", - "table" : "DEFAULT.KYLIN_SALES", - "column" : "OPS_USER_ID", - "derived" : null - }, { - "name" : "OPS_REGION", - "table" : "DEFAULT.KYLIN_SALES", - "column" : "OPS_REGION", + "column" : "REGION", "derived" : null } ], "measures" : [ { @@ -101,7 +56,8 @@ "next_parameter" : null }, "returntype" : "decimal(19,4)" - } + }, + "dependent_measure_ref" : null }, { "name" : "GMV_MIN", "function" : { @@ -112,7 +68,8 @@ "next_parameter" : null }, "returntype" : "decimal(19,4)" - } + }, + "dependent_measure_ref" : null }, { "name" : "GMV_MAX", "function" : { @@ -123,7 +80,8 @@ "next_parameter" : null }, "returntype" : "decimal(19,4)" - } + }, + "dependent_measure_ref" : null }, { "name" : "TRANS_CNT", "function" : { @@ -134,7 +92,8 @@ "next_parameter" : null }, "returntype" : "bigint" - } + }, + "dependent_measure_ref" : null }, { "name" : "SELLER_CNT_HLL", "function" : { @@ -145,7 +104,20 @@ "next_parameter" : null }, "returntype" : "hllc(10)" - } + }, + "dependent_measure_ref" : null + }, { + "name" : "SELLER_FORMAT_CNT", + "function" : { + "expression" : "COUNT_DISTINCT", + "parameter" : { + "type" : "column", + "value" : "LSTG_FORMAT_NAME", + "next_parameter" : null + }, + "returntype" : "hllc(10)" + }, + "dependent_measure_ref" : null }, { "name" : "TOP_SELLER", "function" : { @@ -160,21 +132,13 @@ } }, "returntype" : "topn(100)" - } + }, + "dependent_measure_ref" : null } ], "rowkey" : { "rowkey_columns" : [ { - "column" : "BUYER_ID", - "encoding" : "integer:4" - }, { - "column" : "SELLER_ID", - "encoding" : "integer:4" - }, { - "column" : "TRANS_ID", - "encoding" : "integer:4" - }, { "column" : "PART_DT", - "encoding" : "date" + "encoding" : "dict" }, { "column" : "LEAF_CATEG_ID", "encoding" : "dict" @@ -188,34 +152,16 @@ "column" : "CATEG_LVL3_NAME", "encoding" : "dict" }, { - "column" : "BUYER_ACCOUNT.ACCOUNT_BUYER_LEVEL", - "encoding" : "dict" - }, { - "column" : "SELLER_ACCOUNT.ACCOUNT_SELLER_LEVEL", - "encoding" : "dict" - }, { - "column" : "BUYER_ACCOUNT.ACCOUNT_COUNTRY", - "encoding" : "dict" - }, { - "column" : "SELLER_ACCOUNT.ACCOUNT_COUNTRY", - "encoding" : "dict" - }, { - "column" : "BUYER_COUNTRY.NAME", - "encoding" : "dict" - }, { - "column" : "SELLER_COUNTRY.NAME", - "encoding" : "dict" - }, { "column" : "LSTG_FORMAT_NAME", - "encoding" : "dict" + "encoding" : "fixed_length:12" }, { - "column" : "LSTG_SITE_ID", + "column" : "USER_ID", "encoding" : "dict" }, { - "column" : "OPS_USER_ID", + "column" : "REGION", "encoding" : "dict" }, { - "column" : "OPS_REGION", + "column" : "LSTG_SITE_ID", "encoding" : "dict" } ] }, @@ -224,34 +170,21 @@ "name" : "F1", "columns" : [ { "qualifier" : "M", - "measure_refs" : [ "GMV_SUM", "GMV_MIN", "GMV_MAX", "TRANS_CNT" ] + "measure_refs" : [ "GMV_SUM", "GMV_MIN", "GMV_MAX", "TRANS_CNT", "TOP_SELLER" ] } ] }, { "name" : "F2", "columns" : [ { "qualifier" : "M", - "measure_refs" : [ "SELLER_CNT_HLL", "TOP_SELLER" ] + "measure_refs" : [ "SELLER_CNT_HLL", "SELLER_FORMAT_CNT" ] } ] } ] }, "aggregation_groups" : [ { - "includes" : [ "PART_DT", "META_CATEG_NAME", "CATEG_LVL2_NAME", "CATEG_LVL3_NAME", "LEAF_CATEG_ID", "LSTG_FORMAT_NAME", "LSTG_SITE_ID", "OPS_USER_ID", "OPS_REGION", - "BUYER_ACCOUNT.ACCOUNT_BUYER_LEVEL", "SELLER_ACCOUNT.ACCOUNT_SELLER_LEVEL", "BUYER_ACCOUNT.ACCOUNT_COUNTRY", "SELLER_ACCOUNT.ACCOUNT_COUNTRY", "BUYER_COUNTRY.NAME", "SELLER_COUNTRY.NAME" ], - "select_rule" : { - "hierarchy_dims" : [ [ "META_CATEG_NAME", "CATEG_LVL2_NAME", "CATEG_LVL3_NAME", "LEAF_CATEG_ID" ] ], - "mandatory_dims" : [ "PART_DT" ], - "joint_dims" : [ [ "BUYER_ACCOUNT.ACCOUNT_COUNTRY", "BUYER_COUNTRY.NAME" ], [ "SELLER_ACCOUNT.ACCOUNT_COUNTRY", "SELLER_COUNTRY.NAME" ], - [ "BUYER_ACCOUNT.ACCOUNT_BUYER_LEVEL", "SELLER_ACCOUNT.ACCOUNT_SELLER_LEVEL" ], [ "LSTG_FORMAT_NAME", "LSTG_SITE_ID" ], [ "OPS_USER_ID", "OPS_REGION" ] ] - } - }, { - "includes" : [ "TRANS_ID", "BUYER_ID", "SELLER_ID", - "PART_DT", "META_CATEG_NAME", "CATEG_LVL2_NAME", "CATEG_LVL3_NAME", "LEAF_CATEG_ID", "LSTG_FORMAT_NAME", "LSTG_SITE_ID", "OPS_USER_ID", "OPS_REGION", - "BUYER_ACCOUNT.ACCOUNT_BUYER_LEVEL", "SELLER_ACCOUNT.ACCOUNT_SELLER_LEVEL", "BUYER_ACCOUNT.ACCOUNT_COUNTRY", "SELLER_ACCOUNT.ACCOUNT_COUNTRY", "BUYER_COUNTRY.NAME", "SELLER_COUNTRY.NAME" ], + "includes" : [ "CATEG_LVL2_NAME", "CATEG_LVL3_NAME", "LEAF_CATEG_ID", "LSTG_FORMAT_NAME", "LSTG_SITE_ID", "META_CATEG_NAME", "PART_DT" ], "select_rule" : { - "hierarchy_dims" : [ ], - "mandatory_dims" : [ "TRANS_ID", "BUYER_ID", "SELLER_ID", - "PART_DT", "META_CATEG_NAME", "CATEG_LVL2_NAME", "CATEG_LVL3_NAME", "LEAF_CATEG_ID", "LSTG_FORMAT_NAME", "LSTG_SITE_ID", "OPS_USER_ID", "OPS_REGION", - "BUYER_ACCOUNT.ACCOUNT_BUYER_LEVEL", "SELLER_ACCOUNT.ACCOUNT_SELLER_LEVEL", "BUYER_ACCOUNT.ACCOUNT_COUNTRY", "SELLER_ACCOUNT.ACCOUNT_COUNTRY", "BUYER_COUNTRY.NAME", "SELLER_COUNTRY.NAME" ], + "hierarchy_dims" : [ [ "META_CATEG_NAME", "CATEG_LVL2_NAME", "CATEG_LVL3_NAME" ] ], + "mandatory_dims" : [ ], "joint_dims" : [ ] } } ], @@ -261,8 +194,6 @@ "auto_merge_time_ranges" : null, "retention_range" : 0, "engine_type" : %default_engine_type%, - "storage_type" : %default_engine_type%, - "override_kylin_properties" : { - "kylin.cube.aggrgroup.is-mandatory-only-valid" : "true" - } + "storage_type" : %default_storage_type%, + "override_kylin_properties" : { } } http://git-wip-us.apache.org/repos/asf/kylin/blob/ee47f857/examples/sample_cube/template/model_desc/kylin_sales_model.json ---------------------------------------------------------------------- diff --git a/examples/sample_cube/template/model_desc/kylin_sales_model.json b/examples/sample_cube/template/model_desc/kylin_sales_model.json index 2d3cfb6..3c4fa5a 100644 --- a/examples/sample_cube/template/model_desc/kylin_sales_model.json +++ b/examples/sample_cube/template/model_desc/kylin_sales_model.json @@ -15,60 +15,16 @@ "primary_key" : [ "LEAF_CATEG_ID", "SITE_ID" ], "foreign_key" : [ "LEAF_CATEG_ID", "LSTG_SITE_ID" ] } - }, { - "table" : "DEFAULT.KYLIN_ACCOUNT", - "alias" : "BUYER_ACCOUNT", - "join" : { - "type" : "inner", - "primary_key" : [ "ACCOUNT_ID" ], - "foreign_key" : [ "BUYER_ID" ] - } - }, { - "table" : "DEFAULT.KYLIN_ACCOUNT", - "alias" : "SELLER_ACCOUNT", - "join" : { - "type" : "inner", - "primary_key" : [ "ACCOUNT_ID" ], - "foreign_key" : [ "SELLER_ID" ] - } - }, { - "table" : "DEFAULT.KYLIN_COUNTRY", - "alias" : "BUYER_COUNTRY", - "join" : { - "type" : "inner", - "primary_key" : [ "COUNTRY" ], - "foreign_key" : [ "BUYER_ACCOUNT.ACCOUNT_COUNTRY" ] - } - }, { - "table" : "DEFAULT.KYLIN_COUNTRY", - "alias" : "SELLER_COUNTRY", - "join" : { - "type" : "inner", - "primary_key" : [ "COUNTRY" ], - "foreign_key" : [ "SELLER_ACCOUNT.ACCOUNT_COUNTRY" ] - } }], "dimensions" : [ { - "table" : "DEFAULT.KYLIN_SALES", - "columns" : [ "TRANS_ID", "SELLER_ID", "BUYER_ID", "PART_DT", "LEAF_CATEG_ID", "LSTG_FORMAT_NAME", "LSTG_SITE_ID", "OPS_USER_ID", "OPS_REGION" ] - }, { "table" : "DEFAULT.KYLIN_CAL_DT", "columns" : ["CAL_DT", "WEEK_BEG_DT"] }, { "table" : "DEFAULT.KYLIN_CATEGORY_GROUPINGS", - "columns" : [ "USER_DEFINED_FIELD1", "USER_DEFINED_FIELD3", "META_CATEG_NAME", "CATEG_LVL2_NAME", "CATEG_LVL3_NAME", "LEAF_CATEG_ID", "SITE_ID" ] - }, { - "table" : "BUYER_ACCOUNT", - "columns" : [ "ACCOUNT_ID", "ACCOUNT_BUYER_LEVEL", "ACCOUNT_SELLER_LEVEL", "ACCOUNT_COUNTRY", "ACCOUNT_CONTACT" ] - }, { - "table" : "SELLER_ACCOUNT", - "columns" : [ "ACCOUNT_ID", "ACCOUNT_BUYER_LEVEL", "ACCOUNT_SELLER_LEVEL", "ACCOUNT_COUNTRY", "ACCOUNT_CONTACT" ] + "columns" : [ "USER_DEFINED_FIELD1", "USER_DEFINED_FIELD3", "META_CATEG_NAME", "CATEG_LVL2_NAME", "CATEG_LVL3_NAME" ] }, { - "table" : "BUYER_COUNTRY", - "columns" : [ "COUNTRY", "NAME" ] - }, { - "table" : "SELLER_COUNTRY", - "columns" : [ "COUNTRY", "NAME" ] + "table" : "DEFAULT.KYLIN_SALES", + "columns" : [ "LSTG_FORMAT_NAME", "SELLER_ID", "PART_DT", "USER_ID", "REGION" ] } ], "metrics": [ "PRICE", http://git-wip-us.apache.org/repos/asf/kylin/blob/ee47f857/examples/sample_cube/template/table/DEFAULT.KYLIN_ACCOUNT.json ---------------------------------------------------------------------- diff --git a/examples/sample_cube/template/table/DEFAULT.KYLIN_ACCOUNT.json b/examples/sample_cube/template/table/DEFAULT.KYLIN_ACCOUNT.json deleted file mode 100644 index f1b7755..0000000 --- a/examples/sample_cube/template/table/DEFAULT.KYLIN_ACCOUNT.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "uuid" : "f386e39e-40d7-44c2-9eb3-41b365632231", - - "name" : "KYLIN_ACCOUNT", - "columns" : [ { - "id" : "1", - "name" : "ACCOUNT_ID", - "datatype" : "bigint" - }, { - "id" : "2", - "name" : "ACCOUNT_BUYER_LEVEL", - "datatype" : "int" - }, { - "id" : "3", - "name" : "ACCOUNT_SELLER_LEVEL", - "datatype" : "int" - }, { - "id" : "4", - "name" : "ACCOUNT_COUNTRY", - "datatype" : "string" - }, { - "id" : "5", - "name" : "ACCOUNT_CONTACT", - "datatype" : "string" - } ], - "database" : "DEFAULT", - "last_modified" : 0 -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/kylin/blob/ee47f857/examples/sample_cube/template/table/DEFAULT.KYLIN_CATEGORY_GROUPINGS.json ---------------------------------------------------------------------- diff --git a/examples/sample_cube/template/table/DEFAULT.KYLIN_CATEGORY_GROUPINGS.json b/examples/sample_cube/template/table/DEFAULT.KYLIN_CATEGORY_GROUPINGS.json index accba35..1e1c6a2 100644 --- a/examples/sample_cube/template/table/DEFAULT.KYLIN_CATEGORY_GROUPINGS.json +++ b/examples/sample_cube/template/table/DEFAULT.KYLIN_CATEGORY_GROUPINGS.json @@ -40,7 +40,7 @@ "datatype" : "string" }, { "id" : "10", - "name" : "KYLIN_GROUPINGS_UPD_DATE", + "name" : "KYLIN_GROUPINGS_UPD_DATE", "datatype" : "string" }, { "id" : "11", @@ -48,7 +48,7 @@ "datatype" : "string" }, { "id" : "12", - "name" : "KYLIN_GROUPINGS_UPD_USER", + "name" : "KYLIN_GROUPINGS_UPD_USER", "datatype" : "string" }, { "id" : "13", http://git-wip-us.apache.org/repos/asf/kylin/blob/ee47f857/examples/sample_cube/template/table/DEFAULT.KYLIN_COUNTRY.json ---------------------------------------------------------------------- diff --git a/examples/sample_cube/template/table/DEFAULT.KYLIN_COUNTRY.json b/examples/sample_cube/template/table/DEFAULT.KYLIN_COUNTRY.json deleted file mode 100644 index 8d38810..0000000 --- a/examples/sample_cube/template/table/DEFAULT.KYLIN_COUNTRY.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "uuid" : "e286e39e-40d7-44c2-8fa2-41b365632882", - - "name" : "KYLIN_COUNTRY", - "columns" : [ { - "id" : "1", - "name" : "COUNTRY", - "datatype" : "string" - }, { - "id" : "2", - "name" : "LATITUDE", - "datatype" : "double" - }, { - "id" : "3", - "name" : "LONGITUDE", - "datatype" : "double" - }, { - "id" : "4", - "name" : "NAME", - "datatype" : "string" - } ], - "database" : "DEFAULT", - "last_modified" : 0 -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/kylin/blob/ee47f857/examples/sample_cube/template/table/DEFAULT.KYLIN_SALES.json ---------------------------------------------------------------------- diff --git a/examples/sample_cube/template/table/DEFAULT.KYLIN_SALES.json b/examples/sample_cube/template/table/DEFAULT.KYLIN_SALES.json index 9286215..2bccbeb 100644 --- a/examples/sample_cube/template/table/DEFAULT.KYLIN_SALES.json +++ b/examples/sample_cube/template/table/DEFAULT.KYLIN_SALES.json @@ -38,19 +38,15 @@ "id" : "9", "name" : "SELLER_ID", "datatype" : "bigint" - }, { - "id" : "10", - "name" : "BUYER_ID", - "datatype" : "bigint" - }, { - "id" : "11", - "name" : "OPS_USER_ID", - "datatype" : "string" - }, { - "id" : "12", - "name" : "OPS_REGION", - "datatype" : "string" + }, { + "id" : "10", + "name" : "USER_ID", + "datatype" : "string" + }, { + "id" : "11", + "name" : "REGION", + "datatype" : "string" } ], "database" : "DEFAULT", "last_modified" : 0 -} +}