ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [13/50] [abbrv] ignite git commit: ignite-3860 - fixes
Date Wed, 01 Mar 2017 14:32:56 GMT
ignite-3860 - fixes


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

Branch: refs/heads/master
Commit: 166e65c0f946529852d72bf8a74f12c4130a64dd
Parents: 43bf89f
Author: Sergi Vladykin <sergi.vladykin@gmail.com>
Authored: Tue Feb 21 11:08:27 2017 +0300
Committer: Sergi Vladykin <sergi.vladykin@gmail.com>
Committed: Tue Feb 21 11:08:27 2017 +0300

----------------------------------------------------------------------
 .../query/h2/sql/GridSqlQuerySplitter.java      |  3 ++-
 .../h2/twostep/GridReduceQueryExecutor.java     | 26 ++++++++++----------
 2 files changed, 15 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/166e65c0/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuerySplitter.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuerySplitter.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuerySplitter.java
index 5352c87..165b6b8 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuerySplitter.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuerySplitter.java
@@ -209,7 +209,8 @@ public class GridSqlQuerySplitter {
             boolean allCollocated = true;
 
             for (GridCacheSqlQuery mapSqlQry : splitter.mapSqlQrys) {
-                Prepared prepared = optimize(h2, conn, mapSqlQry.query(), params, true, enforceJoinOrder);
+                Prepared prepared = optimize(h2, conn, mapSqlQry.query(), mapSqlQry.parameters(),
+                    true, enforceJoinOrder);
 
                 allCollocated &= isCollocated((Query)prepared);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/166e65c0/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
index 128ca8e..f813cae 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
@@ -99,6 +99,7 @@ import org.jsr166.ConcurrentHashMap8;
 
 import static org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion.NONE;
 import static org.apache.ignite.internal.processors.cache.query.GridCacheQueryType.SQL_FIELDS;
+import static org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.setupConnection;
 import static org.apache.ignite.internal.processors.query.h2.opt.GridH2QueryType.REDUCE;
 import static org.apache.ignite.internal.processors.query.h2.sql.GridSqlQuerySplitter.mergeTableIdentifier;
 
@@ -674,23 +675,22 @@ public class GridReduceQueryExecutor {
                     if (skipMergeTbl) {
                         List<List<?>> res = new ArrayList<>();
 
-                        assert r.idxs.size() == 1 : r.idxs;
+                        // Simple UNION ALL can have multiple indexes.
+                        for (GridMergeIndex idx : r.idxs) {
+                            Cursor cur = idx.findInStream(null, null);
 
-                        GridMergeIndex idx = r.idxs.get(0);
+                            while (cur.next()) {
+                                Row row = cur.get();
 
-                        Cursor cur = idx.findInStream(null, null);
+                                int cols = row.getColumnCount();
 
-                        while (cur.next()) {
-                            Row row = cur.get();
+                                List<Object> resRow = new ArrayList<>(cols);
 
-                            int cols = row.getColumnCount();
+                                for (int c = 0; c < cols; c++)
+                                    resRow.add(row.getValue(c).getObject());
 
-                            List<Object> resRow = new ArrayList<>(cols);
-
-                            for (int c = 0; c < cols; c++)
-                                resRow.add(row.getValue(c).getObject());
-
-                            res.add(resRow);
+                                res.add(resRow);
+                            }
                         }
 
                         resIter = res.iterator();
@@ -700,7 +700,7 @@ public class GridReduceQueryExecutor {
 
                         UUID locNodeId = ctx.localNodeId();
 
-                        h2.setupConnection(r.conn, false, enforceJoinOrder);
+                        setupConnection(r.conn, false, enforceJoinOrder);
 
                         GridH2QueryContext.set(new GridH2QueryContext(locNodeId, locNodeId,
qryReqId, REDUCE)
                             .pageSize(r.pageSize).distributedJoins(false));


Mime
View raw message