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 2016/10/21 10:07:54 UTC

[6/8] kylin git commit: KYLIN-1971 refactor ModelDesc to use TableRef

http://git-wip-us.apache.org/repos/asf/kylin/blob/f1f69d44/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
new file mode 100644
index 0000000..8d38810
--- /dev/null
+++ b/examples/sample_cube/template/table/DEFAULT.KYLIN_COUNTRY.json
@@ -0,0 +1,24 @@
+{
+  "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/f1f69d44/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 2bccbeb..fbeafb3 100644
--- a/examples/sample_cube/template/table/DEFAULT.KYLIN_SALES.json
+++ b/examples/sample_cube/template/table/DEFAULT.KYLIN_SALES.json
@@ -38,15 +38,23 @@
     "id" : "9",
     "name" : "SELLER_ID",
     "datatype" : "bigint"
-  }, {
-    "id" : "10",
-    "name" : "USER_ID",
-    "datatype" : "string"
-  }, {
-    "id" : "11",
-    "name" : "REGION",
-    "datatype" : "string"
+  }, {
+    "id" : "10",
+    "name" : "BUYER_COUNTRY",
+    "datatype" : "string"
+  }, {
+    "id" : "11",
+    "name" : "SELLER_COUNTRY",
+    "datatype" : "string"
+  }, {
+    "id" : "12",
+    "name" : "USER_ID",
+    "datatype" : "string"
+  }, {
+    "id" : "13",
+    "name" : "REGION",
+    "datatype" : "string"
   } ],
   "database" : "DEFAULT",
   "last_modified" : 0
-}
+}

http://git-wip-us.apache.org/repos/asf/kylin/blob/f1f69d44/examples/test_case_data/localmeta/model_desc/test_kylin_snowflake_model_desc.json
----------------------------------------------------------------------
diff --git a/examples/test_case_data/localmeta/model_desc/test_kylin_snowflake_model_desc.json b/examples/test_case_data/localmeta/model_desc/test_kylin_snowflake_model_desc.json
new file mode 100644
index 0000000..b06a217
--- /dev/null
+++ b/examples/test_case_data/localmeta/model_desc/test_kylin_snowflake_model_desc.json
@@ -0,0 +1,161 @@
+{
+  "uuid": "ac0f4ee2-1dcb-4b07-a38e-4c298563e0e3",
+  "name": "test_kylin_snowflake_model_desc",
+  "lookups": [
+    {
+      "table": "EDW.TEST_CAL_DT",
+      "join": {
+        "type": "left",
+        "primary_key": [
+          "CAL_DT"
+        ],
+        "foreign_key": [
+          "CAL_DT"
+        ]
+      }
+    },
+    {
+      "table": "DEFAULT.TEST_CATEGORY_GROUPINGS",
+      "join": {
+        "type": "left",
+        "primary_key": [
+          "LEAF_CATEG_ID",
+          "SITE_ID"
+        ],
+        "foreign_key": [
+          "LEAF_CATEG_ID",
+          "LSTG_SITE_ID"
+        ]
+      }
+    },
+    {
+      "table": "EDW.TEST_SITES",
+      "join": {
+        "type": "left",
+        "primary_key": [
+          "SITE_ID"
+        ],
+        "foreign_key": [
+          "LSTG_SITE_ID"
+        ]
+      }
+    },
+    {
+      "table": "EDW.TEST_SELLER_TYPE_DIM",
+      "join": {
+        "type": "left",
+        "primary_key": [
+          "SELLER_TYPE_CD"
+        ],
+        "foreign_key": [
+          "SLR_SEGMENT_CD"
+        ]
+      }
+    },
+    {
+      "table": "DEFAULT.TEST_KYLIN_COUNTRY",
+      "alias": "BUYER_COUNTRY",
+      "join": {
+        "type": "left",
+        "primary_key": [
+          "COUNTRY"
+        ],
+        "foreign_key": [
+          "BUYER_COUNTRY"
+        ]
+      }
+    },
+    {
+      "table": "DEFAULT.TEST_KYLIN_COUNTRY",
+      "alias": "SELLER_COUNTRY",
+      "join": {
+        "type": "left",
+        "primary_key": [
+          "COUNTRY"
+        ],
+        "foreign_key": [
+          "SELLER_COUNTRY"
+        ]
+      }
+    }
+  ],
+  "dimensions": [
+    {
+      "table": "default.test_kylin_fact",
+      "columns": [
+        "lstg_format_name",
+        "LSTG_SITE_ID",
+        "SLR_SEGMENT_CD",
+        "TRANS_ID",
+        "CAL_DT",
+        "LEAF_CATEG_ID",
+        "SELLER_ID",
+        "BUYER_COUNTRY",
+        "SELLER_COUNTRY"
+      ]
+    },
+    {
+      "table": "default.test_category_groupings",
+      "columns": [
+        "leaf_categ_id",
+        "site_id",
+        "USER_DEFINED_FIELD1",
+        "USER_DEFINED_FIELD3",
+        "UPD_DATE",
+        "UPD_USER",
+        "meta_categ_name",
+        "categ_lvl2_name",
+        "categ_lvl3_name"
+      ]
+    },
+    {
+      "table": "edw.test_sites",
+      "columns": [
+        "site_id",
+        "site_name",
+        "cre_user"
+      ]
+    },
+    {
+      "table": "edw.test_seller_type_dim",
+      "columns": [
+        "seller_type_cd",
+        "seller_type_desc"
+      ]
+    },
+    {
+      "table": "edw.test_cal_dt",
+      "columns": [
+        "cal_dt",
+        "week_beg_dt"
+      ]
+    },
+    {
+      "table": "BUYER_COUNTRY",
+      "columns": [
+        "country",
+        "name"
+      ]
+    },
+    {
+      "table": "SELLER_COUNTRY",
+      "columns": [
+        "country",
+        "name"
+      ]
+    }
+  ],
+  "metrics": [
+    "PRICE",
+    "ITEM_COUNT",
+    "SELLER_ID"
+  ],
+  "last_modified": 1422435345352,
+  "fact_table": "DEFAULT.TEST_KYLIN_FACT",
+  "filter_condition": null,
+  "partition_desc": {
+    "partition_date_column": "DEFAULT.TEST_KYLIN_FACT.cal_dt",
+    "partition_date_start": 0,
+    "partition_type": "APPEND"
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/kylin/blob/f1f69d44/examples/test_case_data/localmeta/table/DEFAULT.TEST_KYLIN_COUNTRY.json
----------------------------------------------------------------------
diff --git a/examples/test_case_data/localmeta/table/DEFAULT.TEST_KYLIN_COUNTRY.json b/examples/test_case_data/localmeta/table/DEFAULT.TEST_KYLIN_COUNTRY.json
new file mode 100644
index 0000000..95b34c2
--- /dev/null
+++ b/examples/test_case_data/localmeta/table/DEFAULT.TEST_KYLIN_COUNTRY.json
@@ -0,0 +1,24 @@
+{
+  "uuid" : "e286e39e-40d7-44c2-8fa2-41b365632882",
+ 
+  "name" : "TEST_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/f1f69d44/examples/test_case_data/localmeta/table/DEFAULT.TEST_KYLIN_FACT.json
----------------------------------------------------------------------
diff --git a/examples/test_case_data/localmeta/table/DEFAULT.TEST_KYLIN_FACT.json b/examples/test_case_data/localmeta/table/DEFAULT.TEST_KYLIN_FACT.json
index ee21ea0..3e65edd 100644
--- a/examples/test_case_data/localmeta/table/DEFAULT.TEST_KYLIN_FACT.json
+++ b/examples/test_case_data/localmeta/table/DEFAULT.TEST_KYLIN_FACT.json
@@ -38,6 +38,14 @@
     "id" : "9",
     "name" : "SELLER_ID",
     "datatype" : "bigint"
+  }, {
+    "id" : "10",
+    "name" : "BUYER_COUNTRY",
+    "datatype" : "string"
+  }, {
+    "id" : "11",
+    "name" : "SELLER_COUNTRY",
+    "datatype" : "string"
   } ],
   "database" : "DEFAULT",
   "last_modified" : 0