[ 
https://issues.apache.org/jira/browse/KYLIN-5340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiaoxiang Yu resolved KYLIN-5340.
---------------------------------
    Resolution: Fixed

commit hash : 3bee29fcc3ae029c780ffbe3fa289f68e5a34387

> Create model API calls fail when CC expressions are the same
> ------------------------------------------------------------
>
>                 Key: KYLIN-5340
>                 URL: https://issues.apache.org/jira/browse/KYLIN-5340
>             Project: Kylin
>          Issue Type: Bug
>    Affects Versions: 5.0-alpha
>            Reporter: sibing.zhang
>            Priority: Major
>             Fix For: 5.0-alpha
>
>         Attachments: image-2022-12-06-17-36-52-593.png
>
>
> *现象*
>  # 存在已有模型,其包含CC1:LINEORDER.LO_TAX*10,CC2:LINEORDER.LO_TAX+10
>  # 使用创建模型API:POST 
> [http://host:port/kylin/api/models]创建模型。调用时设置参数computed_column_name_auto_adjust=true,且新建CC。在该模型的度量,过滤条件中使用新建的CC。相关接口调用如下:
> {code:java}
> curl --location --request POST 'http://159.27.120.206:7780/kylin/api/models' \
> --header 'Accept-Language: cn' \
> --header 'Content-Type: application/json;charset=utf-8' \
> --header 'Accept: application/vnd.apache.kylin-v4-public+json' \
> --data-raw '{
>     "uuid": null,
>     "owner": "",
>     "project": "comma",
>     "alias": "model2",
>     "fact_table": "SSB4X.LINEORDER",
>     "computed_column_name_auto_adjust":true,
>     "join_tables":
>     [
>         {
>             "table": "SSB4X.CUSTOMER",
>             "alias": "CUSTOMER",
>             "join_relation_type": "MANY_TO_ONE",
>             "flattenable": "flatten",
>             "join":
>             {
>                 "foreign_key":
>                 [
>                     "LINEORDER.LO_CUSTKEY"
>                 ],
>                 "primary_key":
>                 [
>                     "CUSTOMER.C_CUSTKEY"
>                 ],
>                 "simplified_non_equi_join_conditions":
>                 [],
>                 "type": "INNER"
>             }
>         }
>     ],
>     "simplified_dimensions":
>     [
>         {
>             "name": "LO_CUSTKEY",
>             "column": "LINEORDER.LO_CUSTKEY",
>             "status": "DIMENSION",
>             "datatype": "integer"
>         },
>         {
>             "name": "LO_ORDERKEY",
>             "column": "LINEORDER.LO_ORDERKEY",
>             "status": "DIMENSION",
>             "datatype": "bigint"
>         },
>         {
>             "name": "CC3",
>             "column": "LINEORDER.CC3",
>             "status": "DIMENSION",
>             "datatype": "BIGINT"
>         },
>         {
>             "name": "CC4",
>             "column": "LINEORDER.CC4",
>             "status": "DIMENSION",
>             "datatype": "BIGINT"
>         }
>     ],
>     "simplified_measures":
>     [
>         {
>             "expression": "COUNT",
>             "name": "COUNT_ALL",
>             "parameter_value":
>             [
>                 {
>                     "type": "constant",
>                     "value": 1,
>                     "table_guid": null
>                 }
>             ],
>             "return_type": ""
>         },
>         {
>             "name": "sumcc3",
>             "expression": "SUM",
>             "return_type": "",
>             "comment": "",
>             "parameter_value":
>             [
>                 {
>                     "type": "column",
>                     "value": "LINEORDER.CC3"
>                 }
>             ]
>         }
>     ],
>     "computed_columns":
>     [
>         {
>             "tableIdentity": "SSB4X.LINEORDER",
>             "tableAlias": "LINEORDER",
>             "columnName": "CC3",
>             "expression": "LINEORDER.LO_TAX*10",
>             "datatype": "BIGINT"
>         },
>         {
>             "tableIdentity": "SSB4X.LINEORDER",
>             "tableAlias": "LINEORDER",
>             "columnName": "CC4",
>             "expression": "LINEORDER.LO_TAX+10",
>             "datatype": "BIGINT"
>         }
>     ],
>     "last_modified": 0,
>     "filter_condition": "cc3>100",
>     "partition_desc": null,
>     "multi_partition_desc": null,
>     "management_type": "MODEL_BASED",
>     "save_only": true,
>     "with_base_index": true
> }' {code}
> {*}接口调用失败{*}{*}{*}
> !image-2022-12-06-17-36-52-593.png|width=909,height=124!
>  *root cause*
> 自动调整CC名称时,未对维度、度量、模型过滤条件中用到的列做替换。
> *fix design*
> 自动调整CC名称时,对维度、度量、模型过滤条件中用到CC列做替换。



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

Reply via email to