You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Pavel Tupitsyn (Jira)" <ji...@apache.org> on 2025/02/25 08:38:00 UTC
[jira] [Updated] (IGNITE-24618) .NET: LINQ: Constructor parameter count does not match column count, can't emit row reader
[ https://issues.apache.org/jira/browse/IGNITE-24618?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pavel Tupitsyn updated IGNITE-24618:
------------------------------------
Description:
{code}
using var client = await IgniteClient.StartAsync(new IgniteClientConfiguration("localhost:10942"));
await client.Sql.ExecuteAsync(null, "CREATE TABLE IF NOT EXISTS FOO (ID INT PRIMARY KEY, NAME VARCHAR)");
var table = await client.Tables.GetTableAsync("FOO");
var view = table!.GetRecordView<Rec>();
var query = view.AsQueryable()
.Join(view.AsQueryable(), x => x.Id, x => x.Id, (x, y) => new { x, y });
Console.WriteLine(query);
Console.WriteLine(query.First());
{code}
The example above uses a self-join for simplicity, but the same error occurs with two table join. The exception is cryptic:
{code}
System.InvalidOperationException : Constructor parameter count does not match column count, can't emit row reader.
at Apache.Ignite.Internal.Linq.ResultSelector.EmitConstructorReader[T](ConstructorInfo ctorInfo, IReadOnlyList`1 columns, ResultSelectorOptions options) in /home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Linq/ResultSelector.cs:line 161
at Apache.Ignite.Internal.Linq.ResultSelector.<>c__6`1.<Get>b__6_1(ResultSelectorCacheKey`1 k) in /home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Linq/ResultSelector.cs:line 78
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at Apache.Ignite.Internal.Linq.ResultSelector.Get[T](IReadOnlyList`1 columns, Expression selectorExpression, ResultSelectorOptions options) in /home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Linq/ResultSelector.cs:line 76
at Apache.Ignite.Internal.Linq.IgniteQueryExecutor.<>c__DisplayClass9_0`1.<ExecuteResultSetInternalAsync>b__0(IReadOnlyList`1 cols) in /home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Linq/IgniteQueryExecutor.cs:line 135
at Apache.Ignite.Internal.Sql.ResultSet`1..ctor(ClientSocket socket, PooledBuffer buf, RowReaderFactory`1 rowReaderFactory) in /home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Sql/ResultSet.cs:line 76
at Apache.Ignite.Internal.Sql.Sql.ExecuteAsyncInternal[T](ITransaction transaction, SqlStatement statement, RowReaderFactory`1 rowReaderFactory, ICollection`1 args)
at Apache.Ignite.Internal.Linq.IgniteQueryExecutor.ExecuteResultSetInternalAsync[T](QueryModel queryModel) in /home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Linq/IgniteQueryExecutor.cs:line 132
at Apache.Ignite.Internal.Linq.IgniteQueryExecutor.ExecuteSingleInternalAsync[T](QueryModel queryModel, ExecutionOptions options) in /home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Linq/IgniteQueryExecutor.cs:line 152
at Apache.Ignite.Internal.Linq.IgniteQueryExecutor.ExecuteSingle[T](QueryModel queryModel, Boolean returnDefaultWhenEmpty) in /home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Linq/IgniteQueryExecutor.cs:line 72
at Remotion.Linq.Clauses.StreamedData.StreamedSingleValueInfo.ExecuteSingleQueryModel[T](QueryModel queryModel, IQueryExecutor executor)
at Remotion.Linq.Clauses.StreamedData.StreamedSingleValueInfo.ExecuteQueryModel(QueryModel queryModel, IQueryExecutor executor)
at Remotion.Linq.QueryModel.Execute(IQueryExecutor executor)
at Apache.Ignite.Internal.Linq.IgniteQueryProvider.Execute(Expression expression) in /home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Linq/IgniteQueryProvider.cs:line 162
at Apache.Ignite.Internal.Linq.IgniteQueryProvider.Execute[TResult](Expression expression) in /home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Linq/IgniteQueryProvider.cs:line 91
{code}
was:
{code}
using var client = await IgniteClient.StartAsync(new IgniteClientConfiguration("localhost:10942"));
await client.Sql.ExecuteAsync(null, "CREATE TABLE IF NOT EXISTS FOO (ID INT PRIMARY KEY, NAME VARCHAR)");
var table = await client.Tables.GetTableAsync("FOO");
var view = table!.GetRecordView<Rec>();
var query = view.AsQueryable()
.Join(view.AsQueryable(), x => x.Id, x => x.Id, (x, y) => new { x, y });
Console.WriteLine(query);
Console.WriteLine(query.First());
{code}
> .NET: LINQ: Constructor parameter count does not match column count, can't emit row reader
> ------------------------------------------------------------------------------------------
>
> Key: IGNITE-24618
> URL: https://issues.apache.org/jira/browse/IGNITE-24618
> Project: Ignite
> Issue Type: Bug
> Components: platforms, thin client
> Affects Versions: 3.0
> Reporter: Pavel Tupitsyn
> Priority: Major
> Labels: .NET, ignite-3
>
> {code}
> using var client = await IgniteClient.StartAsync(new IgniteClientConfiguration("localhost:10942"));
> await client.Sql.ExecuteAsync(null, "CREATE TABLE IF NOT EXISTS FOO (ID INT PRIMARY KEY, NAME VARCHAR)");
> var table = await client.Tables.GetTableAsync("FOO");
> var view = table!.GetRecordView<Rec>();
> var query = view.AsQueryable()
> .Join(view.AsQueryable(), x => x.Id, x => x.Id, (x, y) => new { x, y });
> Console.WriteLine(query);
> Console.WriteLine(query.First());
> {code}
> The example above uses a self-join for simplicity, but the same error occurs with two table join. The exception is cryptic:
> {code}
> System.InvalidOperationException : Constructor parameter count does not match column count, can't emit row reader.
> at Apache.Ignite.Internal.Linq.ResultSelector.EmitConstructorReader[T](ConstructorInfo ctorInfo, IReadOnlyList`1 columns, ResultSelectorOptions options) in /home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Linq/ResultSelector.cs:line 161
> at Apache.Ignite.Internal.Linq.ResultSelector.<>c__6`1.<Get>b__6_1(ResultSelectorCacheKey`1 k) in /home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Linq/ResultSelector.cs:line 78
> at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
> at Apache.Ignite.Internal.Linq.ResultSelector.Get[T](IReadOnlyList`1 columns, Expression selectorExpression, ResultSelectorOptions options) in /home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Linq/ResultSelector.cs:line 76
> at Apache.Ignite.Internal.Linq.IgniteQueryExecutor.<>c__DisplayClass9_0`1.<ExecuteResultSetInternalAsync>b__0(IReadOnlyList`1 cols) in /home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Linq/IgniteQueryExecutor.cs:line 135
> at Apache.Ignite.Internal.Sql.ResultSet`1..ctor(ClientSocket socket, PooledBuffer buf, RowReaderFactory`1 rowReaderFactory) in /home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Sql/ResultSet.cs:line 76
> at Apache.Ignite.Internal.Sql.Sql.ExecuteAsyncInternal[T](ITransaction transaction, SqlStatement statement, RowReaderFactory`1 rowReaderFactory, ICollection`1 args)
> at Apache.Ignite.Internal.Linq.IgniteQueryExecutor.ExecuteResultSetInternalAsync[T](QueryModel queryModel) in /home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Linq/IgniteQueryExecutor.cs:line 132
> at Apache.Ignite.Internal.Linq.IgniteQueryExecutor.ExecuteSingleInternalAsync[T](QueryModel queryModel, ExecutionOptions options) in /home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Linq/IgniteQueryExecutor.cs:line 152
> at Apache.Ignite.Internal.Linq.IgniteQueryExecutor.ExecuteSingle[T](QueryModel queryModel, Boolean returnDefaultWhenEmpty) in /home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Linq/IgniteQueryExecutor.cs:line 72
> at Remotion.Linq.Clauses.StreamedData.StreamedSingleValueInfo.ExecuteSingleQueryModel[T](QueryModel queryModel, IQueryExecutor executor)
> at Remotion.Linq.Clauses.StreamedData.StreamedSingleValueInfo.ExecuteQueryModel(QueryModel queryModel, IQueryExecutor executor)
> at Remotion.Linq.QueryModel.Execute(IQueryExecutor executor)
> at Apache.Ignite.Internal.Linq.IgniteQueryProvider.Execute(Expression expression) in /home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Linq/IgniteQueryProvider.cs:line 162
> at Apache.Ignite.Internal.Linq.IgniteQueryProvider.Execute[TResult](Expression expression) in /home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Linq/IgniteQueryProvider.cs:line 91
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)