This is an automated email from the ASF dual-hosted git repository. ptupitsyn pushed a commit to branch ignite-27278 in repository https://gitbox.apache.org/repos/asf/ignite-3.git
commit abf3eb35827259fdbdcdf191c7a443985e0ab44d Author: Pavel Tupitsyn <[email protected]> AuthorDate: Tue Dec 23 16:16:33 2025 +0200 wip tests --- .../Apache.Ignite.Tests.Common/Table/IntMapper.cs | 29 ++++++++++++++++++++++ .../dotnet/Apache.Ignite.Tests/Sql/SqlTests.cs | 4 ++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/modules/platforms/dotnet/Apache.Ignite.Tests.Common/Table/IntMapper.cs b/modules/platforms/dotnet/Apache.Ignite.Tests.Common/Table/IntMapper.cs new file mode 100644 index 00000000000..21e955760d2 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Tests.Common/Table/IntMapper.cs @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +namespace Apache.Ignite.Tests.Common.Table; + +using Ignite.Table.Mapper; + +public class IntMapper : IMapper<int> +{ + public void Write(int obj, ref RowWriter rowWriter, IMapperSchema schema) + => rowWriter.WriteInt(obj); + + public int Read(ref RowReader rowReader, IMapperSchema schema) + => rowReader.ReadInt()!.Value; +} diff --git a/modules/platforms/dotnet/Apache.Ignite.Tests/Sql/SqlTests.cs b/modules/platforms/dotnet/Apache.Ignite.Tests/Sql/SqlTests.cs index e0dddee043d..1ad58b49315 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Tests/Sql/SqlTests.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Tests/Sql/SqlTests.cs @@ -25,6 +25,7 @@ namespace Apache.Ignite.Tests.Sql using System.Text; using System.Threading; using System.Threading.Tasks; + using Common.Table; using Ignite.Sql; using Ignite.Table; using Ignite.Transactions; @@ -792,7 +793,7 @@ namespace Apache.Ignite.Tests.Sql } [Test] - public async Task TestCancelQueryExecute([Values("sql", "sql-mapped", "script", "reader", "batch")] string mode) + public async Task TestCancelQueryExecute([Values("sql", "sql-mapped", "sql-mapped2", "script", "reader", "batch")] string mode) { // Cross join will produce 10^N rows, which takes a while to execute. var manyRowsQuery = $"select count (*) from ({GenerateCrossJoin(8)})"; @@ -803,6 +804,7 @@ namespace Apache.Ignite.Tests.Sql { "sql" => Client.Sql.ExecuteAsync(transaction: null, manyRowsQuery, cts.Token), "sql-mapped" => Client.Sql.ExecuteAsync<int>(transaction: null, manyRowsQuery, cts.Token), + "sql-mapped2" => Client.Sql.ExecuteAsync(transaction: null, manyRowsQuery, new IntMapper(), cts.Token), "script" => Client.Sql.ExecuteScriptAsync($"DELETE FROM {TableName} WHERE KEY = ({manyRowsQuery})", cts.Token), "reader" => Client.Sql.ExecuteReaderAsync(transaction: null, manyRowsQuery, cts.Token), "batch" => Client.Sql.ExecuteBatchAsync(null, $"DELETE FROM {TableName} WHERE KEY = ({manyRowsQuery}) + ?", [[1]], cts.Token),
