You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "pengfei.zhan (Jira)" <ji...@apache.org> on 2022/12/07 15:04:00 UTC

[jira] [Commented] (KYLIN-5352) Allow modifying a healthy model by API without SimplifiedMeasure's id in request

    [ https://issues.apache.org/jira/browse/KYLIN-5352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17644383#comment-17644383 ] 

pengfei.zhan commented on KYLIN-5352:
-------------------------------------

h3. Dev Design

Detect the model has this kind of problem if true the id of `SimplifiedMeasure` is needed, otherwise there is no need.

 
h3. Test Evidence

Refined the affected test cases.

> Allow modifying a healthy model by API without SimplifiedMeasure's id in request
> --------------------------------------------------------------------------------
>
>                 Key: KYLIN-5352
>                 URL: https://issues.apache.org/jira/browse/KYLIN-5352
>             Project: Kylin
>          Issue Type: Improvement
>          Components: Modeling
>    Affects Versions: 5.0-alpha
>            Reporter: pengfei.zhan
>            Priority: Major
>             Fix For: 5.0-alpha
>
>
> In some customer environments, we found that two measures with different IDs share the same parameters. For example:
> {code:java}
> // just show the problem measures
> {
>    "name": "measure1",
>    "function" : {
>        "expression" : "SUM",
>        "parameters" : [{
>           "type" : "column",
>           "value" : "TEST_KYLIN_FACT.PRICE"
>         }],
>        "returnType" : "double"
>     },
>    "column" : "PRICE",
>    "comment" : "",
>    "id" : 100047
> }, {
>     "name": "measure2",
>     "function" : {
>     "expression" : "SUM",
>     "parameters" : [{
>         "type" : "column",
>         "value" : "TEST_KYLIN_FACT.PRICE"
>     }],
>     "returnType" : "double"
>     },
>     "column" : "PRICE",
>     "comment" : "",
>     "id" : 100048
> }
> {code}
> We have fixed this problem by using the id of `SimplifiedMeasure` to recognize what we need to do with this model.
> What can we do when we are using the fore-end of Kylin?
>  # Go to the model page;
>  # Search the measure id on the page of `Model` > `Developers` > `JSON`, and record the `parameters` of this measure ;
>  # Search by `parameters` content to get the duplicate measure;
>  # Search related indexes by these two measure names then decide which measure and related indexes to delete.
> Rule of thumb, we usually follow two rules:
> rule1, the measure used by more indexes should retain,
> rule2, the indexes contain more dimensions and measures should retain.
> But What can we do when we are using API to modify a model with the same situation?  We can get this goal by controlling the content of requests (related part, the `SimplifiedMeasure` list).
>  * add a measure, no need to input an id of `SimplifiedMeasure`,
>  * modify a measure, need to input an id of `SimplifiedMeasure` which equals the real id on the to-be-modified model,
>  * remove a measure, this measure should not in the `SimplifiedMeasure` list.
>  
> However, in most cases, the models are normal ones. That's to say, there is no need to use the id of `SimplifiedMeasure` when we are using the API. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)