[
https://issues.apache.org/jira/browse/KYLIN-3236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16353625#comment-16353625
]
Peng Xing commented on KYLIN-3236:
----------------------------------
Hi [~Zhixiong Chen], I have analyzed the web code of 'Advanced Setting', I
understand the logical procession about the Preconditions of 'Advanced
Dictionaries', but I also find two bugs, as follow:
1. The usage combined with 'forEach' and 'splice' has wrong. Deleting operation
in array loop can not be operated from front to back.
{code:java}
//remove deprecated distinct measures
angular.forEach($scope.cubeMetaFrame.dictionaries, function (dict, index) {
if (distinctMeasures.indexOf(dict.column) === -1 &&
reuseColumns.indexOf(dict.column) === -1) {
$scope.cubeMetaFrame.dictionaries.splice(index, 1);
}
});
{code}
2. We should trigger the function 'reGenerateAdvancedDict()' not only after
editing 'Measures' page but also after editing 'Advanced Setting'.
Please review the new patch, thanks!
> The function 'reGenerateAdvancedDict()' has an error logical judgment, which
> will cause an exception when you edit the cube.
> ----------------------------------------------------------------------------------------------------------------------------
>
> Key: KYLIN-3236
> URL: https://issues.apache.org/jira/browse/KYLIN-3236
> Project: Kylin
> Issue Type: Bug
> Components: Web
> Affects Versions: v2.3.0
> Reporter: Peng Xing
> Assignee: Peng Xing
> Priority: Major
> Labels: patch
> Attachments:
> 0001-KYLIN-3236-The-function-reGenerateAdvancedDict-has-a.patch, 1.PNG,
> 2.PNG, 3.PNG
>
>
> # When remove deprecated distinct measures, the code has an error logical
> judgment In function 'reGenerateAdvancedDict()', as follows:
> {code:java}
> //remove deprecated distinct measures
> angular.forEach($scope.cubeMetaFrame.dictionaries, function (dict, index)
> {
> if (distinctMeasures.indexOf(dict.column) === -1 &&
> reuseColumns.indexOf(dict.column) === -1) {
> $scope.cubeMetaFrame.dictionaries.splice(index, 1);
> }
> });
> {code}
> This will result in accidental deletion of advanced dictionaries.
> Please review the patch, thanks!
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)