You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by an...@apache.org on 2015/09/29 10:01:24 UTC

ignite git commit: ignite-1485 Only not indexed fields.

Repository: ignite
Updated Branches:
  refs/heads/ignite-843 87d9f4150 -> ae8035828


ignite-1485 Only not indexed fields.


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

Branch: refs/heads/ignite-843
Commit: ae8035828ee122f1cf1309fe369361fcaa2ab4ad
Parents: 87d9f41
Author: Andrey <an...@gridgain.com>
Authored: Tue Sep 29 15:01:52 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Tue Sep 29 15:01:52 2015 +0700

----------------------------------------------------------------------
 .../main/js/controllers/metadata-controller.js    | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ae803582/modules/control-center-web/src/main/js/controllers/metadata-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/metadata-controller.js b/modules/control-center-web/src/main/js/controllers/metadata-controller.js
index c14169f..8a8f085 100644
--- a/modules/control-center-web/src/main/js/controllers/metadata-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/metadata-controller.js
@@ -452,7 +452,8 @@ consoleModule.controller('metadataController', [
                             var colName = col.name;
                             var jdbcType = $common.findJdbcType(col.type);
 
-                            qryFields.push(queryField(colName, jdbcType));
+                            if (!fieldIndexed(colName, table))
+                                qryFields.push(queryField(colName, jdbcType));
 
                             if (_.includes(table.ascCols, colName))
                                 ascFields.push(queryField(colName, jdbcType));
@@ -524,6 +525,21 @@ consoleModule.controller('metadataController', [
                 });
 
                 /**
+                 * Check field with specified name is indexed.
+                 *
+                 * @param name Field name.
+                 * @param table Table to check indexed fields.
+                 * @returns {boolean} <code>True</code> when field is indexed of <code>false</code> otherwise.
+                 */
+                function fieldIndexed(name, table) {
+                    // Check if in asc or desc fields.
+                    if (_.includes(table.ascCols, name) || _.includes(table.descCols, name) || !table.idxs)
+                        return true;
+
+                    return _.findKey(table.idxs, function(fields) { return _.includes(Object.keys(fields), name); }) != undefined;
+                }
+
+                /**
                  * Generate message to show on confirm dialog.
                  *
                  * @param meta Object to confirm.