ignite-1.9 - test added
@@ -152,6 +152,34 @@ public class IgniteSqlSplitterSelfTest extends GridCommonAbstractTest {
}
}
+ /**
+ *
+ */
+ public void testReplicatedOnlyTables() {
+ IgniteCache<Integer,Value> p = ignite(0).getOrCreateCache(cacheConfig("p", true,
+ Integer.class, Value.class));
+ IgniteCache<Integer,Value> r = ignite(0).getOrCreateCache(cacheConfig("r", false,
+ Integer.class, Value.class));
+
+ try {
+ int cnt = 1000;
+
+ for (int i = 0; i < cnt; i++)
+ r.put(i, new Value(i, -i));
+
+ // Query data from replicated table using partitioned cache.
+ assertEquals(cnt, p.query(new SqlFieldsQuery("select 1 from \"r\".Value")).getAll().size());
+
+ List<List<?>> res = p.query(new SqlFieldsQuery("select count(1) from \"r\".Value")).getAll();
+ assertEquals(1, res.size());
+ assertEquals(cnt, ((Number)res.get(0).get(0)).intValue());
+ }
+ finally {
+ p.destroy();
+ r.destroy();
+ }
+ }
+
/**
* @throws Exception If failed.
*/
