ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [09/48] incubator-ignite git commit: ignite-gg9499 - fixes
Date Tue, 27 Jan 2015 14:25:54 GMT
ignite-gg9499 - fixes


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

Branch: refs/heads/sprint-1
Commit: b16f120bf0958b2047b51605a3cdf19f7974df5f
Parents: 67df1ce
Author: S.Vladykin <svladykin@gridgain.com>
Authored: Mon Dec 22 16:05:34 2014 +0300
Committer: S.Vladykin <svladykin@gridgain.com>
Committed: Mon Dec 22 16:05:34 2014 +0300

----------------------------------------------------------------------
 .../h2/twostep/messages/GridNextPageResponse.java |  6 +++++-
 .../cache/GridCacheCrossCacheQuerySelfTest.java   | 18 +++++++-----------
 2 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b16f120b/modules/indexing/src/main/java/org/gridgain/grid/kernal/processors/query/h2/twostep/messages/GridNextPageResponse.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/gridgain/grid/kernal/processors/query/h2/twostep/messages/GridNextPageResponse.java
b/modules/indexing/src/main/java/org/gridgain/grid/kernal/processors/query/h2/twostep/messages/GridNextPageResponse.java
index 0834f4c..f131604 100644
--- a/modules/indexing/src/main/java/org/gridgain/grid/kernal/processors/query/h2/twostep/messages/GridNextPageResponse.java
+++ b/modules/indexing/src/main/java/org/gridgain/grid/kernal/processors/query/h2/twostep/messages/GridNextPageResponse.java
@@ -156,7 +156,11 @@ public class GridNextPageResponse implements Externalizable {
             int cols = in.readInt();
             int dataSize = in.readInt();
 
-            Data data = Data.create(null, dataSize);
+            byte[] dataBytes = new byte[dataSize];
+
+            in.readFully(dataBytes);
+
+            Data data = Data.create(null, dataBytes);
 
             for (int r = 0; r < rowCnt; r++) {
                 Value[] row = new Value[cols];

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b16f120b/modules/indexing/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
b/modules/indexing/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
index 90a2d4c..b4d6595 100644
--- a/modules/indexing/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
@@ -96,21 +96,19 @@ public class GridCacheCrossCacheQuerySelfTest extends GridCommonAbstractTest
{
     public void testTwoStep() throws Exception {
         fillCaches();
 
-        GridCacheTwoStepQuery q = new GridCacheTwoStepQuery("select * from _cnts_");
-
-        q.addMapQuery("_cnts_", "select count(*) cnt from \"partitioned\".FactPurchase");
-
         GridCacheQueriesEx<Integer, FactPurchase> qx =
             (GridCacheQueriesEx<Integer, FactPurchase>)ignite.<Integer, FactPurchase>cache("partitioned").queries();
 
-        for (List<?> row : qx.execute(q).get())
-            X.println("__ "  + row);
+//        for (Map.Entry<Integer, FactPurchase> e : qx.createSqlQuery(FactPurchase.class,
"1 = 1").execute().get())
+//            X.println("___ "  + e);
 
+        GridCacheTwoStepQuery q = new GridCacheTwoStepQuery("select cast(sum(x) as long)
from _cnts_ where ? = ?", 1, 1);
 
+        q.addMapQuery("_cnts_", "select count(*) x from \"partitioned\".FactPurchase where
? = ?", 2 ,2);
 
-//        Object cnt = .next().get(0);
-//
-//        assertEquals(10L, cnt);
+        Object cnt = qx.execute(q).get().iterator().next().get(0);
+
+        assertEquals(10L, cnt);
     }
 
     /** @throws Exception If failed. */
@@ -134,8 +132,6 @@ public class GridCacheCrossCacheQuerySelfTest extends GridCommonAbstractTest
{
      * @throws IgniteCheckedException If failed.
      */
     private void fillCaches() throws IgniteCheckedException, InterruptedException {
-        awaitPartitionMapExchange();
-
         int idGen = 0;
 
         GridCache<Integer, Object> dimCache = ignite.cache("replicated");


Mime
View raw message