This is an automated email from the ASF dual-hosted git repository.
xxyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git
The following commit(s) were added to refs/heads/master by this push:
new b577521 [KYLIN-4971] Add new measure bitmap_map for count distinct at
frontend. (#222)
b577521 is described below
commit b577521d93b049a65bdc3d7e0dd783018edd5c68
Author: yangjiang <[email protected]>
AuthorDate: Tue Apr 6 19:05:26 2021 +0800
[KYLIN-4971] Add new measure bitmap_map for count distinct at frontend.
(#222)
---
webapp/app/js/controllers/cubeAdvanceSetting.js | 4 ++++
webapp/app/js/controllers/cubeEdit.js | 14 +++++++++++---
webapp/app/js/model/cubeConfig.js | 8 ++++++--
webapp/app/js/model/cubeDescModel.js | 3 ++-
webapp/app/partials/cubeDesigner/advanced_settings.html | 12 +++++++++++-
webapp/app/partials/cubeDesigner/measures.html | 4 ++--
6 files changed, 36 insertions(+), 9 deletions(-)
diff --git a/webapp/app/js/controllers/cubeAdvanceSetting.js
b/webapp/app/js/controllers/cubeAdvanceSetting.js
index 91769cf..78de9fb 100755
--- a/webapp/app/js/controllers/cubeAdvanceSetting.js
+++ b/webapp/app/js/controllers/cubeAdvanceSetting.js
@@ -521,6 +521,10 @@ KylinApp.controller('CubeAdvanceSettingCtrl', function
($scope, $modal,cubeConfi
}
};
+ $scope.isMeasureBitmap_map = function(type) {
+ return type == "bitmap_map";
+ };
+
$scope.changeSnapshotTable = function(changeSnapshot, beforeTableName,
snapshotTableDescList) {
var existSnapshot = _.find(snapshotTableDescList, function(snapshot) {
return snapshot.table_name === changeSnapshot.table_name;
diff --git a/webapp/app/js/controllers/cubeEdit.js
b/webapp/app/js/controllers/cubeEdit.js
index eeed96a..b32900d 100755
--- a/webapp/app/js/controllers/cubeEdit.js
+++ b/webapp/app/js/controllers/cubeEdit.js
@@ -740,7 +740,8 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q,
$routeParams, $locatio
var distinctMeasures = [];
angular.forEach($scope.cubeMetaFrame.measures, function (measure, index) {
- if (measure.function.expression === 'COUNT_DISTINCT' &&
measure.function.returntype === 'bitmap' && !$scope.isIntMeasure(measure)) {
+ if (measure.function.expression === 'COUNT_DISTINCT' &&
(measure.function.returntype === 'bitmap' || measure.function.returntype ===
'bitmap_map' )
+ && !$scope.isIntMeasure(measure)) {
var measureColumn = measure.function.parameter.value;
distinctMeasures.push(measureColumn);
//keep backward compatibility
@@ -758,8 +759,15 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q,
$routeParams, $locatio
if (!isColumnExit) {
var dict = CubeDescModel.createDictionaries();
dict.column = measureColumn;
- dict.builder = cubeConfig.buildDictionaries[0].value;
- $scope.cubeMetaFrame.dictionaries.push(dict)
+ if (measure.function.returntype === 'bitmap_map') {
+ dict.builder = cubeConfig.buildDictionariesForBitMap_Map[0].value;
+ dict.type = measure.function.returntype;
+ $scope.cubeMetaFrame.dictionaries.push(dict)
+ } else {
+ dict.builder = cubeConfig.buildDictionariesForBitMap[0].value;
+ dict.type = measure.function.returntype;
+ $scope.cubeMetaFrame.dictionaries.push(dict)
+ }
}
}
});
diff --git a/webapp/app/js/model/cubeConfig.js
b/webapp/app/js/model/cubeConfig.js
index 77285f9..e895663 100644
--- a/webapp/app/js/model/cubeConfig.js
+++ b/webapp/app/js/model/cubeConfig.js
@@ -51,7 +51,8 @@ KylinApp.constant('cubeConfig', {
{name: 'Error Rate < 2.44%', value: 'hllc(14)'},
{name: 'Error Rate < 1.72%', value: 'hllc(15)'},
{name: 'Error Rate < 1.22%', value: 'hllc(16)'},
- {name: 'Precisely (More Memory And Storage Needed)', value: 'bitmap'}
+ {name: 'Precisely (More Memory And Storage Needed)', value: 'bitmap'},
+ {name: 'Precisely (Different Encoding Among Segments)', value:
'bitmap_map'}
],
topNTypes: [
{name: 'Top 10', value: "topn(10)"},
@@ -119,10 +120,13 @@ KylinApp.constant('cubeConfig', {
true,false
],
statusNeedNofity:['ERROR', 'DISCARDED', 'SUCCEED'],
- buildDictionaries:[
+ buildDictionariesForBitMap:[
{name:"Global Dictionary",
value:"org.apache.kylin.dict.GlobalDictionaryBuilder"},
{name:"Segment Dictionary",
value:"org.apache.kylin.dict.global.SegmentAppendTrieDictBuilder"}
],
+ buildDictionariesForBitMap_Map:[
+ {name:"Segment Dictionary",
value:"org.apache.kylin.dict.global.SegmentAppendTrieDictBuilder"}
+ ],
needSetLengthEncodingList:['fixed_length','fixed_length_hex','int','integer'],
snapshotStorageTypes: [
{name: 'Meta Store', value: 'metaStore'},
diff --git a/webapp/app/js/model/cubeDescModel.js
b/webapp/app/js/model/cubeDescModel.js
index 6cd0fe2..9fcbec3 100644
--- a/webapp/app/js/model/cubeDescModel.js
+++ b/webapp/app/js/model/cubeDescModel.js
@@ -97,7 +97,8 @@ KylinApp.service('CubeDescModel', function (kylinConfig) {
var dictionaries = {
"column": null,
"builder": null,
- "reuse":null
+ "reuse":null,
+ "type":null
}
return dictionaries;
}
diff --git a/webapp/app/partials/cubeDesigner/advanced_settings.html
b/webapp/app/partials/cubeDesigner/advanced_settings.html
index f41d42e..abc7d39 100755
--- a/webapp/app/partials/cubeDesigner/advanced_settings.html
+++ b/webapp/app/partials/cubeDesigner/advanced_settings.html
@@ -489,12 +489,22 @@
<label class="col-xs-12 col-sm-3 control-label
no-padding-right font-color-default"><b>Builder Class</b></label>
<div class="col-xs-12 col-sm-6">
<select class="form-control" chosen
+
ng-if="isMeasureBitmap_map(newDictionaries.type)"
ng-model="newDictionaries.builder"
- ng-options="item.value as item.name for item in
cubeConfig.buildDictionaries"
+ ng-options="item.value as item.name for item in
cubeConfig.buildDictionariesForBitMap_Map"
required>
<option value="">-- Select a builder class--</option>
</select>
</div>
+ <div class="col-xs-12 col-sm-6">
+ <select class="form-control" chosen
+
ng-if="!isMeasureBitmap_map(newDictionaries.type)"
+ ng-model="newDictionaries.builder"
+ ng-options="item.value as item.name for item in
cubeConfig.buildDictionariesForBitMap"
+ required>
+ <option value="">-- Select a builder class--</option>
+ </select>
+ </div>
</div>
</div>
<!--Reuse-->
diff --git a/webapp/app/partials/cubeDesigner/measures.html
b/webapp/app/partials/cubeDesigner/measures.html
index 19e8795..a4579e3 100755
--- a/webapp/app/partials/cubeDesigner/measures.html
+++ b/webapp/app/partials/cubeDesigner/measures.html
@@ -233,11 +233,11 @@
</div>
<!--Group by Column-->
- <div class="form-group"
ng-if="newMeasure.function.expression ===
'TOP_N'||(newMeasure.function.expression === 'COUNT_DISTINCT' &&
newMeasure.function.returntype!=='bitmap')" >
+ <div class="form-group"
ng-if="newMeasure.function.expression ===
'TOP_N'||(newMeasure.function.expression === 'COUNT_DISTINCT' &&
newMeasure.function.returntype!=='bitmap'&&
(newMeasure.function.returntype!=='bitmap_map')" >
<div class="row">
<label class="col-xs-12 col-sm-3 control-label
no-padding-right font-color-default">
<b ng-if="newMeasure.function.expression ===
'TOP_N'">Group by Column:</b>
- <b ng-if="newMeasure.function.expression ===
'COUNT_DISTINCT' && (newMeasure.function.returntype!=='bitmap')">Additional
distinct column in this measure:</b>
+ <b ng-if="newMeasure.function.expression ===
'COUNT_DISTINCT' && (newMeasure.function.returntype!=='bitmap'&&
(newMeasure.function.returntype!=='bitmap_map')">Additional distinct column in
this measure:</b>
</label>
<div class="form-group large-popover" >
<div class="box-body">