This is an automated email from the ASF dual-hosted git repository.
namelchev pushed a commit to branch ignite-2.18
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/ignite-2.18 by this push:
new a0b9d9fc0ba IGNITE-28387 Deprecate lazy flag of SqlFieldsQuery in
platforms (#12949)
a0b9d9fc0ba is described below
commit a0b9d9fc0ba13de630b68b6c2a03ecdfd7c11f12
Author: Nikita Amelchev <[email protected]>
AuthorDate: Mon Mar 30 12:22:39 2026 +0300
IGNITE-28387 Deprecate lazy flag of SqlFieldsQuery in platforms (#12949)
(cherry picked from commit f456f590ad4e2544db4f66884432861779fc495a)
---
.../java/org/apache/ignite/IgniteJdbcThinDataSource.java | 4 ++++
.../org/apache/ignite/cache/query/SqlFieldsQuery.java | 4 ++--
.../core/include/ignite/cache/query/query_sql_fields.h | 6 ++++--
.../cpp/thin-client-test/src/sql_fields_query_test.cpp | 2 +-
.../include/ignite/thin/cache/query/query_sql_fields.h | 4 +++-
.../Cache/Query/CacheQueriesTest.cs | 2 ++
.../Cache/Query/Linq/CacheLinqTest.Introspection.cs | 16 +++++++++++-----
.../Cache/Query/Linq/CacheLinqTest.Misc.cs | 3 ++-
.../Client/Cache/SqlQueryTest.cs | 2 ++
.../Apache.Ignite.Core/Cache/Query/SqlFieldsQuery.cs | 9 ++++++++-
.../Apache.Ignite.Core/Impl/Client/Cache/CacheClient.cs | 2 ++
.../Apache.Ignite.Linq/Impl/CacheFieldsQueryExecutor.cs | 2 ++
.../platforms/dotnet/Apache.Ignite.Linq/QueryOptions.cs | 4 ++++
13 files changed, 47 insertions(+), 13 deletions(-)
diff --git
a/modules/core/src/main/java/org/apache/ignite/IgniteJdbcThinDataSource.java
b/modules/core/src/main/java/org/apache/ignite/IgniteJdbcThinDataSource.java
index 35302031940..bc5dc85977c 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteJdbcThinDataSource.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteJdbcThinDataSource.java
@@ -313,14 +313,18 @@ public class IgniteJdbcThinDataSource implements
DataSource, Serializable {
/**
* @return Lazy query execution flag.
+ * @deprecated Use query page size property instead.
*/
+ @Deprecated(forRemoval = true)
public boolean isLazy() {
return props.isLazy();
}
/**
* @param lazy Lazy query execution flag.
+ * @deprecated Use query page size property instead.
*/
+ @Deprecated(forRemoval = true)
public void setLazy(boolean lazy) {
props.setLazy(lazy);
}
diff --git
a/modules/core/src/main/java/org/apache/ignite/cache/query/SqlFieldsQuery.java
b/modules/core/src/main/java/org/apache/ignite/cache/query/SqlFieldsQuery.java
index d921fb8ca04..bab9c5ad6bf 100644
---
a/modules/core/src/main/java/org/apache/ignite/cache/query/SqlFieldsQuery.java
+++
b/modules/core/src/main/java/org/apache/ignite/cache/query/SqlFieldsQuery.java
@@ -339,7 +339,7 @@ public class SqlFieldsQuery extends Query<List<?>> {
* @return {@code this} For chaining.
* @deprecated Use {@link #setPageSize(int)} instead.
*/
- @Deprecated
+ @Deprecated(forRemoval = true)
public SqlFieldsQuery setLazy(boolean lazy) {
this.lazy = lazy;
@@ -354,7 +354,7 @@ public class SqlFieldsQuery extends Query<List<?>> {
* @return Lazy flag.
* @deprecated Use {@link #getPageSize()} instead.
*/
- @Deprecated
+ @Deprecated(forRemoval = true)
public boolean isLazy() {
return lazy;
}
diff --git
a/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h
b/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h
index 0f90efb8194..4a186abd3ec 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h
@@ -54,7 +54,7 @@ namespace ignite
loc(false),
distributedJoins(false),
enforceJoinOrder(false),
- lazy(false),
+ lazy(true),
args()
{
// No-op.
@@ -73,7 +73,7 @@ namespace ignite
loc(loc),
distributedJoins(false),
enforceJoinOrder(false),
- lazy(false),
+ lazy(true),
args()
{
// No-op.
@@ -220,6 +220,7 @@ namespace ignite
* See SetLazy(bool) for more information.
*
* @return Lazy flag.
+ * @deprecated Deprecated for removal. Use the page size
instead.
*/
bool IsLazy() const
{
@@ -240,6 +241,7 @@ namespace ignite
* Defaults to @c false, meaning that the whole result set is
fetched to memory eagerly.
*
* @param lazy Lazy query execution flag.
+ * @deprecated Deprecated for removal. Use the page size
instead.
*/
void SetLazy(bool lazy)
{
diff --git
a/modules/platforms/cpp/thin-client-test/src/sql_fields_query_test.cpp
b/modules/platforms/cpp/thin-client-test/src/sql_fields_query_test.cpp
index 4220db89700..d2eca8205bb 100644
--- a/modules/platforms/cpp/thin-client-test/src/sql_fields_query_test.cpp
+++ b/modules/platforms/cpp/thin-client-test/src/sql_fields_query_test.cpp
@@ -109,7 +109,7 @@ BOOST_AUTO_TEST_CASE(SqlFieldsQueryDefaults)
BOOST_CHECK(!qry.IsCollocated());
BOOST_CHECK(!qry.IsDistributedJoins());
BOOST_CHECK(!qry.IsEnforceJoinOrder());
- BOOST_CHECK(!qry.IsLazy());
+ BOOST_CHECK(qry.IsLazy());
}
BOOST_AUTO_TEST_CASE(SqlFieldsQuerySetGet)
diff --git
a/modules/platforms/cpp/thin-client/include/ignite/thin/cache/query/query_sql_fields.h
b/modules/platforms/cpp/thin-client/include/ignite/thin/cache/query/query_sql_fields.h
index fde76a87e12..289e7b93ea1 100644
---
a/modules/platforms/cpp/thin-client/include/ignite/thin/cache/query/query_sql_fields.h
+++
b/modules/platforms/cpp/thin-client/include/ignite/thin/cache/query/query_sql_fields.h
@@ -68,7 +68,7 @@ namespace ignite
loc(false),
distributedJoins(false),
enforceJoinOrder(false),
- lazy(false),
+ lazy(true),
collocated(false),
parts(),
updateBatchSize(1),
@@ -340,6 +340,7 @@ namespace ignite
* See SetLazy(bool) for more information.
*
* @return Lazy flag.
+ * @deprecated Deprecated for removal. Use the page size
instead.
*/
bool IsLazy() const
{
@@ -360,6 +361,7 @@ namespace ignite
* Defaults to @c false, meaning that the whole result set
is fetched to memory eagerly.
*
* @param lazy Lazy query execution flag.
+ * @deprecated Deprecated for removal. Use the page size
instead.
*/
void SetLazy(bool lazy)
{
diff --git
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
index 22ffd5443c6..4cacdc76087 100644
---
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
+++
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
@@ -398,7 +398,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
#pragma warning restore 618
Local = loc,
Timeout = TimeSpan.FromSeconds(2),
+#pragma warning disable 618
Lazy = lazy
+#pragma warning restore 618
};
using (var cursor = cache.Query(qry))
diff --git
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Introspection.cs
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Introspection.cs
index a55eeb8bfb2..6201e73ce1e 100644
---
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Introspection.cs
+++
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Introspection.cs
@@ -56,7 +56,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Linq
ReplicatedOnly = true,
#pragma warning restore 618
Colocated = true,
+#pragma warning disable 618
Lazy = true,
+#pragma warning restore 618
UpdateBatchSize = 12,
EnableDistributedJoins = true
}).Where(x => x.Key > 10).ToCacheQueryable();
@@ -84,7 +86,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Linq
#pragma warning restore 618
Assert.IsTrue(fq.Colocated);
Assert.AreEqual(TimeSpan.FromSeconds(2.5), fq.Timeout);
+#pragma warning disable 618
Assert.IsTrue(fq.Lazy);
+#pragma warning restore 618
Assert.IsTrue(fq.EnableDistributedJoins);
Assert.AreEqual(12, fq.UpdateBatchSize);
Assert.IsNull(fq.Partitions);
@@ -125,7 +129,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Linq
Assert.AreEqual(SqlFieldsQuery.DefaultPageSize, fq.PageSize);
Assert.IsFalse(fq.EnableDistributedJoins);
Assert.IsFalse(fq.EnforceJoinOrder);
- Assert.IsFalse(fq.Lazy);
+#pragma warning disable 618
+ Assert.IsTrue(fq.Lazy);
+#pragma warning restore 618
Assert.AreEqual(new[] {1, 2}, fq.Partitions);
str = fieldsQuery.ToString();
@@ -133,11 +139,11 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Linq
? "CacheQueryable [CacheName=person_org, TableName=Person,
Query=SqlFieldsQuery " +
"[Sql=select _T0.\"Name\" from PERSON_ORG_SCHEMA.\"Person\"
as _T0, Arguments=[], Local=False, " +
"PageSize=1024, EnableDistributedJoins=False,
EnforceJoinOrder=False, " +
- "Timeout=00:00:00, Partitions=[1, 2], UpdateBatchSize=1,
Colocated=False, Schema=, Lazy=False]]"
+ "Timeout=00:00:00, Partitions=[1, 2], UpdateBatchSize=1,
Colocated=False, Schema=, Lazy=True]]"
: "CacheQueryable [CacheName=person_org, TableName=Person,
Query=SqlFieldsQuery " +
"[Sql=select _T0.NAME from PERSON_ORG_SCHEMA.Person as _T0,
Arguments=[], Local=False, " +
"PageSize=1024, EnableDistributedJoins=False,
EnforceJoinOrder=False, " +
- "Timeout=00:00:00, Partitions=[1, 2], UpdateBatchSize=1,
Colocated=False, Schema=, Lazy=False]]", str);
+ "Timeout=00:00:00, Partitions=[1, 2], UpdateBatchSize=1,
Colocated=False, Schema=, Lazy=True]]", str);
// Check distributed joins flag propagation
var distrQuery = cache.AsCacheQueryable(new QueryOptions {
EnableDistributedJoins = true })
@@ -154,13 +160,13 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Linq
"(((_T0.\"_KEY\" > ?) and (_T0.\"age1\" > ?)) " +
"and (_T0.\"Name\" like \'%\' || ? || \'%\') ),
Arguments=[10, 20, x], Local=False, " +
"PageSize=1024, EnableDistributedJoins=True,
EnforceJoinOrder=False, " +
- "Timeout=00:00:00, Partitions=[], UpdateBatchSize=1,
Colocated=False, Schema=, Lazy=False]]"
+ "Timeout=00:00:00, Partitions=[], UpdateBatchSize=1,
Colocated=False, Schema=, Lazy=True]]"
: "CacheQueryable [CacheName=person_org, TableName=Person,
Query=SqlFieldsQuery " +
"[Sql=select _T0._KEY, _T0._VAL from
PERSON_ORG_SCHEMA.Person as _T0 where " +
"(((_T0._KEY > ?) and (_T0.AGE1 > ?)) " +
"and (_T0.NAME like \'%\' || ? || \'%\') ), Arguments=[10,
20, x], Local=False, " +
"PageSize=1024, EnableDistributedJoins=True,
EnforceJoinOrder=False, " +
- "Timeout=00:00:00, Partitions=[], UpdateBatchSize=1,
Colocated=False, Schema=, Lazy=False]]", str);
+ "Timeout=00:00:00, Partitions=[], UpdateBatchSize=1,
Colocated=False, Schema=, Lazy=True]]", str);
}
}
}
diff --git
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Misc.cs
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Misc.cs
index df5e893f6db..dcad4bf72cb 100644
---
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Misc.cs
+++
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Misc.cs
@@ -31,6 +31,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Linq
using System.Linq.Expressions;
using Apache.Ignite.Core.Cache;
using Apache.Ignite.Core.Cache.Configuration;
+ using Apache.Ignite.Core.Common;
using Apache.Ignite.Linq;
using NUnit.Framework;
using NUnit.Framework.Constraints;
@@ -347,7 +348,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Linq
});
// ReSharper disable once ReturnValueOfPureMethodIsNotUsed
- var ex = Assert.Throws<CacheException>(() =>
+ var ex = Assert.Throws<IgniteException>(() =>
{
for (var i = 0; i < 100; i++)
{
diff --git
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/SqlQueryTest.cs
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/SqlQueryTest.cs
index 7bbf522fed7..bdb11c99274 100644
---
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/SqlQueryTest.cs
+++
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/SqlQueryTest.cs
@@ -110,7 +110,9 @@ namespace Apache.Ignite.Core.Tests.Client.Cache
// Filter.
qry = new SqlFieldsQuery("select Name from Person where Id = ?", 1)
{
+#pragma warning disable 618
Lazy = true,
+#pragma warning restore 618
PageSize = 5,
};
Assert.AreEqual("Person 1", cache.Query(qry).Single().Single());
diff --git
a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlFieldsQuery.cs
b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlFieldsQuery.cs
index 40c1622e22c..d3ef89a75c4 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlFieldsQuery.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlFieldsQuery.cs
@@ -59,6 +59,9 @@ namespace Apache.Ignite.Core.Cache.Query
PageSize = DefaultPageSize;
UpdateBatchSize = DefaultUpdateBatchSize;
+#pragma warning disable 618
+ Lazy = true;
+#pragma warning restore 618
}
/// <summary>
@@ -154,6 +157,7 @@ namespace Apache.Ignite.Core.Cache.Query
/// OutOfMemoryError. Use this flag as a hint for Ignite to fetch
result set lazily, thus minimizing memory
/// consumption at the cost of moderate performance hit.
/// </summary>
+ [Obsolete("Deprecated for removal. Use the page size instead.")]
public bool Lazy { get; set; }
/// <summary>
@@ -186,12 +190,13 @@ namespace Apache.Ignite.Core.Cache.Query
var parts = Partitions == null
? ""
: string.Join(", ", Partitions.Select(x => x.ToString()));
-
+#pragma warning disable 618
return string.Format("SqlFieldsQuery [Sql={0}, Arguments=[{1}],
Local={2}, PageSize={3}, " +
"EnableDistributedJoins={4},
EnforceJoinOrder={5}, Timeout={6}, Partitions=[{7}], " +
"UpdateBatchSize={8}, Colocated={9},
Schema={10}, Lazy={11}]", Sql, args, Local,
PageSize, EnableDistributedJoins,
EnforceJoinOrder, Timeout, parts,
UpdateBatchSize, Colocated, Schema, Lazy);
+#pragma warning restore 618
}
/** <inheritdoc /> */
@@ -213,7 +218,9 @@ namespace Apache.Ignite.Core.Cache.Query
writer.WriteBoolean(EnableDistributedJoins);
writer.WriteBoolean(EnforceJoinOrder);
+#pragma warning disable 618
writer.WriteBoolean(Lazy); // Lazy flag.
+#pragma warning restore 618
writer.WriteInt((int) Timeout.TotalMilliseconds);
#pragma warning disable 618
writer.WriteBoolean(ReplicatedOnly);
diff --git
a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Client/Cache/CacheClient.cs
b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Client/Cache/CacheClient.cs
index 236fa33ae53..f9426ab2f66 100644
---
a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Client/Cache/CacheClient.cs
+++
b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Client/Cache/CacheClient.cs
@@ -942,7 +942,9 @@ namespace Apache.Ignite.Core.Impl.Client.Cache
#pragma warning restore 618
writer.WriteBoolean(qry.EnforceJoinOrder);
writer.WriteBoolean(qry.Colocated);
+#pragma warning disable 618
writer.WriteBoolean(qry.Lazy);
+#pragma warning restore 618
writer.WriteTimeSpanAsLong(qry.Timeout);
writer.WriteBoolean(includeColumns);
diff --git
a/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheFieldsQueryExecutor.cs
b/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheFieldsQueryExecutor.cs
index 780dd4e6dd4..7bf7908ade7 100644
---
a/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheFieldsQueryExecutor.cs
+++
b/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheFieldsQueryExecutor.cs
@@ -210,7 +210,9 @@ namespace Apache.Ignite.Linq.Impl
Colocated = _options.Colocated,
Local = _options.Local,
Arguments = args,
+#pragma warning disable 618
Lazy = _options.Lazy,
+#pragma warning restore 618
UpdateBatchSize = _options.UpdateBatchSize,
Partitions = _options.Partitions
};
diff --git a/modules/platforms/dotnet/Apache.Ignite.Linq/QueryOptions.cs
b/modules/platforms/dotnet/Apache.Ignite.Linq/QueryOptions.cs
index 3249835df53..65ee860f93c 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Linq/QueryOptions.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Linq/QueryOptions.cs
@@ -41,6 +41,9 @@ namespace Apache.Ignite.Linq
{
PageSize = DefaultPageSize;
UpdateBatchSize = DefaultUpdateBatchSize;
+#pragma warning disable 618
+ Lazy = true;
+#pragma warning restore 618
}
/// <summary>
@@ -128,6 +131,7 @@ namespace Apache.Ignite.Linq
/// OutOfMemoryError. Use this flag as a hint for Ignite to fetch
result set lazily, thus minimizing memory
/// consumption at the cost of moderate performance hit.
/// </summary>
+ [Obsolete("Deprecated for removal. Use the page size instead.")]
public bool Lazy { get; set; }
/// <summary>