You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2016/02/15 08:51:49 UTC

[05/50] [abbrv] ignite git commit: ignite-split2 - minor fixes

ignite-split2 - minor fixes


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

Branch: refs/heads/ignite-1232
Commit: 5c4f8b22dd230de03e7552f87000fb2acc804884
Parents: 5a0bf09
Author: S.Vladykin <sv...@gridgain.com>
Authored: Sat Dec 5 18:31:50 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Sat Dec 5 18:31:50 2015 +0300

----------------------------------------------------------------------
 .../query/h2/opt/GridH2Collocation.java         | 37 ++++++++------------
 1 file changed, 14 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/5c4f8b22/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Collocation.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Collocation.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Collocation.java
index 13af99b..10cd0fe 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Collocation.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Collocation.java
@@ -82,20 +82,6 @@ public final class GridH2Collocation {
     }
 
     /**
-     * @param select Select.
-     */
-    public void select(Select select) {
-        this.select = select;
-    }
-
-    /**
-     * @return Select.
-     */
-    public Select select() {
-        return select;
-    }
-
-    /**
      * @return List of unions.
      */
     public List<GridH2Collocation> unions() {
@@ -115,9 +101,17 @@ public final class GridH2Collocation {
      */
     private boolean childFilters(TableFilter[] childFilters) {
         assert childFilters != null;
-        assert select == childFilters[0].getSelect();
 
-        if (Arrays.equals(this.childFilters, childFilters))
+        Select select = childFilters[0].getSelect();
+
+        assert this.select == null || this.select == select;
+
+        if (this.select == null) {
+            this.select = select;
+
+            assert this.childFilters == null;
+        }
+        else if (Arrays.equals(this.childFilters, childFilters))
             return false;
 
         childsOrderFinalized = false;
@@ -545,17 +539,15 @@ public final class GridH2Collocation {
             if (c == null) {
                 c = new GridH2Collocation(null, -1);
 
-                c.select(filters[0].getSelect());
-
                 qctx.queryCollocation(c);
             }
         }
 
-        // Handle union. We have to rely on fact that select will be the same on uppermost select.
-        // For sub-queries we will drop collocation models, so that they will be recalculated anyways.
         Select select = filters[0].getSelect();
 
-        if (c.select() != select) {
+        // Handle union. We have to rely on fact that select will be the same on uppermost select.
+        // For sub-queries we will drop collocation models, so that they will be recalculated anyways.
+        if (c.select != null && c.select != select) {
             List<GridH2Collocation> unions = c.unions();
 
             int i = 1;
@@ -570,7 +562,7 @@ public final class GridH2Collocation {
                 for (; i < unions.size(); i++) {
                     GridH2Collocation u = unions.get(i);
 
-                    if (u.select() == select) {
+                    if (u.select == select) {
                         c = u;
 
                         break;
@@ -583,7 +575,6 @@ public final class GridH2Collocation {
 
                 unions.add(c);
 
-                c.select(select);
                 c.unions(unions);
             }
         }