ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [48/50] incubator-ignite git commit: ignite-950: fixed fields queiries
Date Fri, 19 Jun 2015 10:35:34 GMT
ignite-950: fixed fields queiries


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

Branch: refs/heads/ignite-950
Commit: 6e413729d3e7ca292173fd6e3491eb79664eb12b
Parents: 41a821f
Author: Denis Magda <dmagda@gridgain.com>
Authored: Fri Jun 19 13:10:36 2015 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Fri Jun 19 13:10:36 2015 +0300

----------------------------------------------------------------------
 .../cache/CacheOptimizedObjectImpl.java         |  2 +-
 ...acheOptimizedMarshallerExtQuerySelfTest.java | 25 ++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6e413729/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOptimizedObjectImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOptimizedObjectImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOptimizedObjectImpl.java
index fe5a644..f07344c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOptimizedObjectImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOptimizedObjectImpl.java
@@ -130,7 +130,7 @@ public class CacheOptimizedObjectImpl extends CacheObjectAdapter {
         assert val != null || valBytes != null;
 
         if (val == null && ctx.storeValue())
-            val = ctx.processor().unmarshal(ctx, valBytes, ldr);
+            val = ctx.processor().unmarshal(ctx, valBytes, start, len, ldr);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6e413729/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOptimizedMarshallerExtQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOptimizedMarshallerExtQuerySelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOptimizedMarshallerExtQuerySelfTest.java
index d9f85aa..010f3e6 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOptimizedMarshallerExtQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheOptimizedMarshallerExtQuerySelfTest.java
@@ -21,6 +21,8 @@ import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.query.*;
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.processors.cache.query.*;
+import org.apache.ignite.internal.processors.query.*;
 import org.apache.ignite.marshaller.optimized.ext.*;
 
 import javax.cache.*;
@@ -127,6 +129,29 @@ public class IgniteCacheOptimizedMarshallerExtQuerySelfTest extends GridCacheAbs
     }
 
     /**
+     * @throws Exception In case of error.
+     */
+    public void testFieldsQuery() throws Exception {
+        IgniteCache<Integer, Person> cache = grid(0).cache(null);
+
+        QueryCursor<List<?>> cur = cache.query(new SqlFieldsQuery("select name,
address, zip" +
+            " from Person where zip IN (1,2)"));
+
+        List<?> result = cur.getAll();
+
+        assertTrue(result.size() == 2);
+
+        for (Object row : result) {
+            ArrayList<Object> list = (ArrayList<Object>)row;
+
+            Address addr = (Address)list.get(1);
+            int zip = (int)list.get(2);
+
+            assertEquals(addr.zip, zip);
+        }
+    }
+
+    /**
      * @return Cache type metadata.
      */
     private Collection<CacheTypeMetadata> cacheTypeMetadata() {


Mime
View raw message