You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by nj...@apache.org on 2020/07/01 08:32:19 UTC
[kylin] 37/41: KYLIN-4602 Fix query display format not correct in
insight table
This is an automated email from the ASF dual-hosted git repository.
nju_yaho pushed a commit to tag ebay-3.1.0-release-20200701
in repository https://gitbox.apache.org/repos/asf/kylin.git
commit 69fd35b4e121fd27bb3089b064e238510ba300eb
Author: sanjulian <ju...@hotmail.com>
AuthorDate: Sun Jun 28 13:43:44 2020 +0800
KYLIN-4602 Fix query display format not correct in insight table
---
webapp/app/js/controllers/query.js | 2 +-
webapp/app/js/utils/utils.js | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/webapp/app/js/controllers/query.js b/webapp/app/js/controllers/query.js
index 6601666..d75f3a7 100644
--- a/webapp/app/js/controllers/query.js
+++ b/webapp/app/js/controllers/query.js
@@ -218,7 +218,7 @@ KylinApp
}
angular.forEach(oneQuery.result.data,function(row,index){
angular.forEach(row,function(column,value){
- var float =VdmUtil.SCToFloat(column);
+ var float =VdmUtil.SCToFloat(column, result.columnMetas.find(function(columnMeta){ return columnMeta.label === value}).columnTypeName);
if (float!=""){
oneQuery.result.data[index][value]=parseFloat(float);
}
diff --git a/webapp/app/js/utils/utils.js b/webapp/app/js/utils/utils.js
index 9c92a02..31e4739 100644
--- a/webapp/app/js/utils/utils.js
+++ b/webapp/app/js/utils/utils.js
@@ -65,8 +65,12 @@ KylinApp.factory('VdmUtil', function ($modal, $timeout, $location, $anchorScroll
return fmt;
},
- SCToFloat:function(data){
+ SCToFloat:function(data, type){
var resultValue = "";
+ var columnType = ['TINYINT', 'SMALLINT', 'INT', 'BIGINT', 'INTEGER', 'DECIMAL', 'DOUBLE', 'FLOAT'];
+ if (!!type && !columnType.includes(type)) {
+ return resultValue;
+ }
if (data&&data.indexOf('E') != -1){
var regExp = new RegExp('^((\\d+.?\\d+)[Ee]{1}(\\d+))$', 'ig');
var result = regExp.exec(data);