You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2015/11/13 09:09:28 UTC

[2/2] ignite git commit: IGNITE-1870 Fixed minor bugs for agg functions logic.

IGNITE-1870 Fixed minor bugs for agg functions logic.


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

Branch: refs/heads/ignite-843-rc1
Commit: d5412a5f79a4ad53679d55bf35d4ed7e2aabb46a
Parents: fbf6a04d
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Fri Nov 13 15:07:46 2015 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Fri Nov 13 15:07:46 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/sql-controller.js                 | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d5412a5f/modules/control-center-web/src/main/js/controllers/sql-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/sql-controller.js b/modules/control-center-web/src/main/js/controllers/sql-controller.js
index 48b0976..a4188db 100644
--- a/modules/control-center-web/src/main/js/controllers/sql-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/sql-controller.js
@@ -525,8 +525,11 @@ consoleModule.controller('sqlController',
             curCols.forEach(function (curCol) {
                 var col = _.find(availableCols, {label: curCol.label});
 
-                if (col && acceptableType(col.type))
+                if (col && acceptableType(col.type)) {
+                    col.aggFx = curCol.aggFx;
+
                     retainedCols.push(col);
+                }
             });
 
             // If nothing was restored, add first acceptable column.
@@ -969,7 +972,7 @@ consoleModule.controller('sqlController',
                 return _sum(rows, idx);
 
             case 'AVG':
-                return len > 0 ? _sum(idx) / len : 0;
+                return len > 0 ? _sum(rows, idx) / len : 0;
 
             case 'COUNT':
                 return len;