IGNITE-9171: SQL: redesigned lazy mode. This closes #5473.
diff --git a/spec/query/SqlFieldsQuery.spec.js b/spec/query/SqlFieldsQuery.spec.js
index c81838a..bf75759 100644
--- a/spec/query/SqlFieldsQuery.spec.js
+++ b/spec/query/SqlFieldsQuery.spec.js
@@ -77,12 +77,31 @@
catch(error => done.fail(error));
});
- it('get all with page size', (done) => {
+ it('get all with page size lazy true', (done) => {
Promise.resolve().
then(async () => {
let cache = igniteClient.getCache(CACHE_NAME);
const cursor = await cache.query(
- new SqlFieldsQuery(`SELECT * FROM ${TABLE_NAME}`).setPageSize(1));
+ new SqlFieldsQuery(`SELECT * FROM ${TABLE_NAME}`).setPageSize(1).setLazy(true));
+ const set = new Set();
+ for (let fields of await cursor.getAll()) {
+ expect(fields.length).toBe(2);
+ expect(generateValue(fields[0]) === fields[1]).toBe(true);
+ set.add(fields[0]);
+ expect(fields[0] >= 0 && fields[0] < ELEMENTS_NUMBER).toBe(true);
+ }
+ expect(set.size).toBe(ELEMENTS_NUMBER);
+ }).
+ then(done).
+ catch(error => done.fail(error));
+ });
+
+ it('get all with page size lazy false', (done) => {
+ Promise.resolve().
+ then(async () => {
+ let cache = igniteClient.getCache(CACHE_NAME);
+ const cursor = await cache.query(
+ new SqlFieldsQuery(`SELECT * FROM ${TABLE_NAME}`).setPageSize(1).setLazy(false));
const set = new Set();
for (let fields of await cursor.getAll()) {
expect(fields.length).toBe(2);