zeppelin git commit: [Zeppelin-3224] - Fix "ultimate" visualization

2018-05-02 Thread zjffdu
Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.8 8b23485e8 -> 4c3a010df


[Zeppelin-3224] - Fix "ultimate" visualization

### What is this PR for?
This PR fixes problems with incorrect data visualization using "ultimate". With 
certain aggregations, the data was not displayed. Also PR improves sorting by 
columns / rows, before PR it compared by Unicode encoding, but now if there are 
only numeric data on the axis, sorting will be by values.

### What type of PR is it?
[Bug Fix & Improvement]

### What is the Jira issue?
[ZEPPELIN-3224](https://issues.apache.org/jira/browse/ZEPPELIN-3224)

### Screenshots (if appropriate)
**Error:**

![error](https://user-images.githubusercontent.com/30798933/37035027-3ca6022c-215c-11e8-901c-d33e833ad505.PNG)

**Now:**

![default](https://user-images.githubusercontent.com/30798933/37038600-48482d8a-2166-11e8-87cd-d0cb861441d2.PNG)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Savalek 
Author: tinkoff-dwh 

Closes #2841 from Savalek/ZEPPELIN-3224 and squashes the following commits:

f546b457c [Savalek] fix count of arguments in parseFloat function
a56ea59d9 [Savalek] Improved number check
5c866b183 [tinkoff-dwh] small fix
e7d1cd7cc [tinkoff-dwh] Merge branch 'master' into ZEPPELIN-3224
d4b2a4913 [Savalek] add test
17d3f8d0e [Savalek] add tests for sortWithNumberSupport()
dc78f3d2b [Savalek] code style fix
ba7a6e3e4 [tinkoff-dwh] Merge branch 'master' into ZEPPELIN-3224
9583f2cce [Savalek] small fix
eab5d86d2 [Savalek] Merge branch 'master' into ZEPPELIN-3224
33676b468 [Savalek] fix XY legend sort for numbers
94026be39 [Savalek] fix graph display

(cherry picked from commit c1c1aa892dbd7621815c19a9d72b175a330ee51e)
Signed-off-by: Jeff Zhang 


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/4c3a010d
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/4c3a010d
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/4c3a010d

Branch: refs/heads/branch-0.8
Commit: 4c3a010dfa17be15958389a20c9bb12fe524cbce
Parents: 8b23485
Author: Savalek 
Authored: Fri Apr 6 11:58:50 2018 +0300
Committer: Jeff Zhang 
Committed: Thu May 3 08:46:00 2018 +0800

--
 .../tabledata/advanced-transformation-util.js   | 38 +---
 .../advanced-transformation-util.test.js| 37 +++
 zeppelin-web/src/app/tabledata/tabledata.js |  4 +++
 3 files changed, 67 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/4c3a010d/zeppelin-web/src/app/tabledata/advanced-transformation-util.js
--
diff --git a/zeppelin-web/src/app/tabledata/advanced-transformation-util.js 
b/zeppelin-web/src/app/tabledata/advanced-transformation-util.js
index 97c1b2c..71ed7b8 100644
--- a/zeppelin-web/src/app/tabledata/advanced-transformation-util.js
+++ b/zeppelin-web/src/app/tabledata/advanced-transformation-util.js
@@ -771,7 +771,7 @@ export function getKGACube(rows, keyColumns, groupColumns, 
aggrColumns) {
 cube = {[mergedGroupColumnName]: cube};
 keyNames = [mergedGroupColumnName];
   } else {
-keyNames = Object.keys(cube).sort(); /** keys should be sorted */
+keyNames = sortWithNumberSupport(Object.keys(cube)); /** keys should be 
sorted */
   }
 
   return {
@@ -883,7 +883,7 @@ export function getKAGCube(rows, keyColumns, groupColumns, 
aggrColumns) {
 cube = {[mergedGroupColumnName]: cube};
 keyNames = [mergedGroupColumnName];
   } else {
-keyNames = Object.keys(cube).sort(); /** keys should be sorted */
+keyNames = sortWithNumberSupport(Object.keys(cube)); /** keys should be 
sorted */
   }
 
   return {
@@ -1015,8 +1015,8 @@ export function getKKGACube(rows, key1Columns, 
key2Columns, groupColumns, aggrCo
 } /** end loop for aggrColumns */
   }
 
-  let key1Names = Object.keys(key1NameSet).sort(); /** keys should be sorted */
-  let key2Names = Object.keys(key2NameSet).sort(); /** keys should be sorted */
+  let key1Names = sortWithNumberSupport(Object.keys(key1NameSet)); /** keys 
should be sorted */
+  let key2Names = sortWithNumberSupport(Object.keys(key2NameSet)); /** keys 
should be sorted */
 
   return {
 cube: cube,
@@ -1072,7 +1072,7 @@ export function getNameWithIndex(names) {
 
 export function getArrayRowsFromKKGACube(cube, schema, aggregatorColumns,
  key1Names, key2Names, groupNameSet, 
selectorNameWithIndex) {
-  const sortedSelectors = Object.keys(selectorNameWithIndex).sort();
+  const sortedSelectors = 

zeppelin git commit: [Zeppelin-3224] - Fix "ultimate" visualization

2018-05-02 Thread moon
Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.8 b05f1fd10 -> c4e37d619


[Zeppelin-3224] - Fix "ultimate" visualization

### What is this PR for?
This PR fixes problems with incorrect data visualization using "ultimate". With 
certain aggregations, the data was not displayed. Also PR improves sorting by 
columns / rows, before PR it compared by Unicode encoding, but now if there are 
only numeric data on the axis, sorting will be by values.

### What type of PR is it?
[Bug Fix & Improvement]

### What is the Jira issue?
[ZEPPELIN-3224](https://issues.apache.org/jira/browse/ZEPPELIN-3224)

### Screenshots (if appropriate)
**Error:**

![error](https://user-images.githubusercontent.com/30798933/37035027-3ca6022c-215c-11e8-901c-d33e833ad505.PNG)

**Now:**

![default](https://user-images.githubusercontent.com/30798933/37038600-48482d8a-2166-11e8-87cd-d0cb861441d2.PNG)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Savalek 
Author: tinkoff-dwh 

Closes #2841 from Savalek/ZEPPELIN-3224 and squashes the following commits:

f546b457c [Savalek] fix count of arguments in parseFloat function
a56ea59d9 [Savalek] Improved number check
5c866b183 [tinkoff-dwh] small fix
e7d1cd7cc [tinkoff-dwh] Merge branch 'master' into ZEPPELIN-3224
d4b2a4913 [Savalek] add test
17d3f8d0e [Savalek] add tests for sortWithNumberSupport()
dc78f3d2b [Savalek] code style fix
ba7a6e3e4 [tinkoff-dwh] Merge branch 'master' into ZEPPELIN-3224
9583f2cce [Savalek] small fix
eab5d86d2 [Savalek] Merge branch 'master' into ZEPPELIN-3224
33676b468 [Savalek] fix XY legend sort for numbers
94026be39 [Savalek] fix graph display

(cherry picked from commit c1c1aa892dbd7621815c19a9d72b175a330ee51e)
Signed-off-by: Lee moon soo 


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/c4e37d61
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/c4e37d61
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/c4e37d61

Branch: refs/heads/branch-0.8
Commit: c4e37d6191288265995c507a37d5dc472ad311b3
Parents: b05f1fd
Author: Savalek 
Authored: Fri Apr 6 11:58:50 2018 +0300
Committer: Lee moon soo 
Committed: Wed May 2 15:33:17 2018 -0400

--
 .../tabledata/advanced-transformation-util.js   | 38 +---
 .../advanced-transformation-util.test.js| 37 +++
 zeppelin-web/src/app/tabledata/tabledata.js |  4 +++
 3 files changed, 67 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/c4e37d61/zeppelin-web/src/app/tabledata/advanced-transformation-util.js
--
diff --git a/zeppelin-web/src/app/tabledata/advanced-transformation-util.js 
b/zeppelin-web/src/app/tabledata/advanced-transformation-util.js
index 97c1b2c..71ed7b8 100644
--- a/zeppelin-web/src/app/tabledata/advanced-transformation-util.js
+++ b/zeppelin-web/src/app/tabledata/advanced-transformation-util.js
@@ -771,7 +771,7 @@ export function getKGACube(rows, keyColumns, groupColumns, 
aggrColumns) {
 cube = {[mergedGroupColumnName]: cube};
 keyNames = [mergedGroupColumnName];
   } else {
-keyNames = Object.keys(cube).sort(); /** keys should be sorted */
+keyNames = sortWithNumberSupport(Object.keys(cube)); /** keys should be 
sorted */
   }
 
   return {
@@ -883,7 +883,7 @@ export function getKAGCube(rows, keyColumns, groupColumns, 
aggrColumns) {
 cube = {[mergedGroupColumnName]: cube};
 keyNames = [mergedGroupColumnName];
   } else {
-keyNames = Object.keys(cube).sort(); /** keys should be sorted */
+keyNames = sortWithNumberSupport(Object.keys(cube)); /** keys should be 
sorted */
   }
 
   return {
@@ -1015,8 +1015,8 @@ export function getKKGACube(rows, key1Columns, 
key2Columns, groupColumns, aggrCo
 } /** end loop for aggrColumns */
   }
 
-  let key1Names = Object.keys(key1NameSet).sort(); /** keys should be sorted */
-  let key2Names = Object.keys(key2NameSet).sort(); /** keys should be sorted */
+  let key1Names = sortWithNumberSupport(Object.keys(key1NameSet)); /** keys 
should be sorted */
+  let key2Names = sortWithNumberSupport(Object.keys(key2NameSet)); /** keys 
should be sorted */
 
   return {
 cube: cube,
@@ -1072,7 +1072,7 @@ export function getNameWithIndex(names) {
 
 export function getArrayRowsFromKKGACube(cube, schema, aggregatorColumns,
  key1Names, key2Names, groupNameSet, 
selectorNameWithIndex) {
-  const sortedSelectors = Object.keys(selectorNameWithIndex).sort();
+  const sortedSelectors = 

zeppelin git commit: [Zeppelin-3224] - Fix "ultimate" visualization

2018-05-02 Thread moon
Repository: zeppelin
Updated Branches:
  refs/heads/master 0c3260e91 -> c1c1aa892


[Zeppelin-3224] - Fix "ultimate" visualization

### What is this PR for?
This PR fixes problems with incorrect data visualization using "ultimate". With 
certain aggregations, the data was not displayed. Also PR improves sorting by 
columns / rows, before PR it compared by Unicode encoding, but now if there are 
only numeric data on the axis, sorting will be by values.

### What type of PR is it?
[Bug Fix & Improvement]

### What is the Jira issue?
[ZEPPELIN-3224](https://issues.apache.org/jira/browse/ZEPPELIN-3224)

### Screenshots (if appropriate)
**Error:**

![error](https://user-images.githubusercontent.com/30798933/37035027-3ca6022c-215c-11e8-901c-d33e833ad505.PNG)

**Now:**

![default](https://user-images.githubusercontent.com/30798933/37038600-48482d8a-2166-11e8-87cd-d0cb861441d2.PNG)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Savalek 
Author: tinkoff-dwh 

Closes #2841 from Savalek/ZEPPELIN-3224 and squashes the following commits:

f546b457c [Savalek] fix count of arguments in parseFloat function
a56ea59d9 [Savalek] Improved number check
5c866b183 [tinkoff-dwh] small fix
e7d1cd7cc [tinkoff-dwh] Merge branch 'master' into ZEPPELIN-3224
d4b2a4913 [Savalek] add test
17d3f8d0e [Savalek] add tests for sortWithNumberSupport()
dc78f3d2b [Savalek] code style fix
ba7a6e3e4 [tinkoff-dwh] Merge branch 'master' into ZEPPELIN-3224
9583f2cce [Savalek] small fix
eab5d86d2 [Savalek] Merge branch 'master' into ZEPPELIN-3224
33676b468 [Savalek] fix XY legend sort for numbers
94026be39 [Savalek] fix graph display


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/c1c1aa89
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/c1c1aa89
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/c1c1aa89

Branch: refs/heads/master
Commit: c1c1aa892dbd7621815c19a9d72b175a330ee51e
Parents: 0c3260e
Author: Savalek 
Authored: Fri Apr 6 11:58:50 2018 +0300
Committer: Lee moon soo 
Committed: Wed May 2 15:32:53 2018 -0400

--
 .../tabledata/advanced-transformation-util.js   | 38 +---
 .../advanced-transformation-util.test.js| 37 +++
 zeppelin-web/src/app/tabledata/tabledata.js |  4 +++
 3 files changed, 67 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/c1c1aa89/zeppelin-web/src/app/tabledata/advanced-transformation-util.js
--
diff --git a/zeppelin-web/src/app/tabledata/advanced-transformation-util.js 
b/zeppelin-web/src/app/tabledata/advanced-transformation-util.js
index 97c1b2c..71ed7b8 100644
--- a/zeppelin-web/src/app/tabledata/advanced-transformation-util.js
+++ b/zeppelin-web/src/app/tabledata/advanced-transformation-util.js
@@ -771,7 +771,7 @@ export function getKGACube(rows, keyColumns, groupColumns, 
aggrColumns) {
 cube = {[mergedGroupColumnName]: cube};
 keyNames = [mergedGroupColumnName];
   } else {
-keyNames = Object.keys(cube).sort(); /** keys should be sorted */
+keyNames = sortWithNumberSupport(Object.keys(cube)); /** keys should be 
sorted */
   }
 
   return {
@@ -883,7 +883,7 @@ export function getKAGCube(rows, keyColumns, groupColumns, 
aggrColumns) {
 cube = {[mergedGroupColumnName]: cube};
 keyNames = [mergedGroupColumnName];
   } else {
-keyNames = Object.keys(cube).sort(); /** keys should be sorted */
+keyNames = sortWithNumberSupport(Object.keys(cube)); /** keys should be 
sorted */
   }
 
   return {
@@ -1015,8 +1015,8 @@ export function getKKGACube(rows, key1Columns, 
key2Columns, groupColumns, aggrCo
 } /** end loop for aggrColumns */
   }
 
-  let key1Names = Object.keys(key1NameSet).sort(); /** keys should be sorted */
-  let key2Names = Object.keys(key2NameSet).sort(); /** keys should be sorted */
+  let key1Names = sortWithNumberSupport(Object.keys(key1NameSet)); /** keys 
should be sorted */
+  let key2Names = sortWithNumberSupport(Object.keys(key2NameSet)); /** keys 
should be sorted */
 
   return {
 cube: cube,
@@ -1072,7 +1072,7 @@ export function getNameWithIndex(names) {
 
 export function getArrayRowsFromKKGACube(cube, schema, aggregatorColumns,
  key1Names, key2Names, groupNameSet, 
selectorNameWithIndex) {
-  const sortedSelectors = Object.keys(selectorNameWithIndex).sort();
+  const sortedSelectors = 
sortWithNumberSupport(Object.keys(selectorNameWithIndex));
   const sortedSelectorNameWithIndex = getNameWithIndex(sortedSelectors);
 
   const selectorRows = new