Hi all:

  There are 2 questions bothering me as follows:


  1. In kylin 1.5+,  the type of dimensions includes 'Normal' & 'Derived', and 
'Hierarchy' is removed from the dimension tab button to aggregation groups, 
being a kind of select_rule(@see New Aggregation Group). For the hierarchy 
dimension, what kind of dimensions should I choose when designing a cube, 
normal or derived?


  2. In API kylin/api/cube_desc/{cubeName}, I can get derived columns' 
dimension name, e.g. In the examples below, the dimension name of derived 
column DIMB_CODE is '????A', but for the hierarchy columns, e.g. If I have a 
hierarchy dimension named date, and the levels are year, month, day. In the API 
I can only figure out year, month and day is three level of a dimension, but I 
don't know which dimension are they belong to?


  The following json string is an example of my test case. Looking forward to 
your help, thanks~~




e.g.


{
    "uuid":"b4307b44-8ca7-410d-ab29-5ac7974f77e7",
    "version":"1.5.2",
    "name":"C_Customer_SaveB",
    "description":"????????????????",
    "dimensions":[
        {
            "name":"????A",
            "table":"DEFAULT.DIMA_DI_D",
            "column":null,
            "derived":[
                "DIMA_CODE",
                "DIMA_NAME"
            ]
        },
        {
            "name":"????B",
            "table":"DEFAULT.DIMB_DI_D",
            "column":null,
            "derived":[
                "DIMB_CODE",
                "DIMB_NAME"
            ]
        },
        {
            "name":"????C_L1",
            "table":"DEFAULT.DIMC_DI_H",
            "column":"DIMC_LEVEL_1",
            "derived":null
        },
        {
            "name":"????C_L2",
            "table":"DEFAULT.DIMC_DI_H",
            "column":"DIMC_LEVEL_2",
            "derived":null
        },
        {
            "name":"????C_L3",
            "table":"DEFAULT.DIMC_DI_H",
            "column":"DIMC_LEVEL_3",
            "derived":null
        },
        {
            "name":"????D_L1",
            "table":"DEFAULT.DIMD_DI_H",
            "column":"DIMD_LEVEL_1",
            "derived":null
        },
        {
            "name":"????D_L2",
            "table":"DEFAULT.DIMD_DI_H",
            "column":"DIMD_LEVEL_2",
            "derived":null
        },
        {
            "name":"????D_L3",
            "table":"DEFAULT.DIMD_DI_H",
            "column":"DIMD_LEVEL_3",
            "derived":null
        }
    ],
    "measures":[
        {
            "name":"_COUNT_",
            "function":{
                "expression":"COUNT",
                "parameter":{
                    "type":"constant",
                    "value":"1",
                    "next_parameter":null
                },
                "returntype":"bigint"
            },
            "dependent_measure_ref":null
        },
        {
            "name":"????SUM",
            "function":{
                "expression":"SUM",
                "parameter":{
                    "type":"column",
                    "value":"MEASURE",
                    "next_parameter":null
                },
                "returntype":"decimal"
            },
            "dependent_measure_ref":null
        },
        {
            "name":"????MIN",
            "function":{
                "expression":"MIN",
                "parameter":{
                    "type":"column",
                    "value":"MEASURE",
                    "next_parameter":null
                },
                "returntype":"double"
            },
            "dependent_measure_ref":null
        },
        {
            "name":"????MAX",
            "function":{
                "expression":"MAX",
                "parameter":{
                    "type":"column",
                    "value":"MEASURE",
                    "next_parameter":null
                },
                "returntype":"double"
            },
            "dependent_measure_ref":null
        },
        {
            "name":"????COUNT_DISTINCT",
            "function":{
                "expression":"COUNT_DISTINCT",
                "parameter":{
                    "type":"column",
                    "value":"MEASURE",
                    "next_parameter":null
                },
                "returntype":"hllc10"
            },
            "dependent_measure_ref":null
        },
        {
            "name":"????TOPN",
            "function":{
                "expression":"TOP_N",
                "parameter":{
                    "type":"column",
                    "value":"MEASURE",
                    "next_parameter":{
                        "type":"column",
                        "value":"DIMA_CODE",
                        "next_parameter":null
                    }
                },
                "returntype":"topn(1000)"
            },
            "dependent_measure_ref":null
        },
        {
            "name":"????_RAW",
            "function":{
                "expression":"RAW",
                "parameter":{
                    "type":"column",
                    "value":"MEASURE",
                    "next_parameter":null
                },
                "returntype":"raw"
            },
            "dependent_measure_ref":null
        }
    ],
    "rowkey":{
        "rowkey_columns":[
            {
                "column":"DIMA_ID",
                "encoding":"dict",
                "isShardBy":false
            },
            {
                "column":"DIMB_ID",
                "encoding":"dict",
                "isShardBy":false
            },
            {
                "column":"DIMC_LEVEL_1",
                "encoding":"dict",
                "isShardBy":false
            },
            {
                "column":"DIMC_LEVEL_2",
                "encoding":"dict",
                "isShardBy":false
            },
            {
                "column":"DIMC_LEVEL_3",
                "encoding":"dict",
                "isShardBy":false
            },
            {
                "column":"DIMD_LEVEL_1",
                "encoding":"dict",
                "isShardBy":false
            },
            {
                "column":"DIMD_LEVEL_2",
                "encoding":"dict",
                "isShardBy":false
            },
            {
                "column":"DIMD_LEVEL_3",
                "encoding":"dict",
                "isShardBy":false
            }
        ]
    },
    "signature":"NMpOd+FGWvuTwP+neqeMQg==",
    "last_modified":1465787014776,
    "model_name":"M_Customer_SaveB",
    "null_string":null,
    "hbase_mapping":{
        "column_family":[
            {
                "name":"F1",
                "columns":[
                    {
                        "qualifier":"M",
                        "measure_refs":[
                            "_COUNT_",
                            "????SUM",
                            "????MIN",
                            "????MAX",
                            "????TOPN",
                            "????_RAW"
                        ]
                    }
                ]
            },
            {
                "name":"F2",
                "columns":[
                    {
                        "qualifier":"M",
                        "measure_refs":[
                            "????COUNT_DISTINCT"
                        ]
                    }
                ]
            }
        ]
    },
    "aggregation_groups":[
        {
            "includes":[
                "DIMA_ID",
                "DIMB_ID",
                "DIMC_LEVEL_1",
                "DIMC_LEVEL_2",
                "DIMC_LEVEL_3",
                "DIMD_LEVEL_1",
                "DIMD_LEVEL_2",
                "DIMD_LEVEL_3"
            ],
            "select_rule":{
                "hierarchy_dims":[
                    [
                        "DIMC_LEVEL_1",
                        "DIMC_LEVEL_2",
                        "DIMC_LEVEL_3"
                    ],
                    [
                        "DIMD_LEVEL_1",
                        "DIMD_LEVEL_2",
                        "DIMD_LEVEL_3"
                    ]
                ],
                "mandatory_dims":[
                    "DIMA_ID"
                ],
                "joint_dims":[

                ]
            }
        }
    ],
    "notify_list":[
        "[email protected]",
        "[email protected]"
    ],
    "status_need_notify":[
        "ERROR",
        "DISCARDED",
        "SUCCEED"
    ],
    "partition_date_start":1465689600000,
    "partition_date_end":3153600000000,
    "auto_merge_time_ranges":[
        604800000,
        2419200000
    ],
    "retention_range":0,
    "engine_type":2,
    "storage_type":2,
    "override_kylin_properties":{

    }
}

Reply via email to