KYLIN-3145 Support Kafka JSON message whose property name includes _ (#4028)
Signed-off-by: shaofengshi <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/01bd0d41 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/01bd0d41 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/01bd0d41 Branch: refs/heads/master Commit: 01bd0d41475962e4f63e09c17c0bb1cd319384db Parents: 5075f59 Author: luguosheng1314 <[email protected]> Authored: Wed Feb 7 10:58:13 2018 +0800 Committer: shaofengshi <[email protected]> Committed: Fri Feb 9 09:57:35 2018 +0800 ---------------------------------------------------------------------- webapp/app/js/controllers/sourceMeta.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/01bd0d41/webapp/app/js/controllers/sourceMeta.js ---------------------------------------------------------------------- diff --git a/webapp/app/js/controllers/sourceMeta.js b/webapp/app/js/controllers/sourceMeta.js index 7deef76..49a9613 100755 --- a/webapp/app/js/controllers/sourceMeta.js +++ b/webapp/app/js/controllers/sourceMeta.js @@ -683,14 +683,15 @@ KylinApp //streaming table data change structure var columnList=[] - function changeObjTree(obj,base){ + function changeObjTree(obj,base,comment){ base=base?base+"_":""; + comment= comment?comment+"|":"" for(var i in obj){ if(Object.prototype.toString.call(obj[i])=="[object Object]"){ - changeObjTree(obj[i],base+i); + changeObjTree(obj[i],base+i,comment+i); continue; } - columnList.push(createNewObj(base+i,obj[i])); + columnList.push(createNewObj(base+i,obj[i],comment+i)); } } @@ -722,12 +723,13 @@ KylinApp return defaultType; } - function createNewObj(key,val){ + function createNewObj(key,val,comment){ var obj={}; obj.name=key; obj.type=checkValType(val,key); obj.fromSource="Y"; obj.checked="Y"; + obj.comment=comment; if(Object.prototype.toString.call(val)=="[object Array]"){ obj.checked="N"; } @@ -798,6 +800,7 @@ KylinApp var columnInstance = { "id": ++$index, "name": column.name, + "comment": /[|]/.test(column.comment)? column.comment : "", "datatype": column.type } columns.push(columnInstance);
