[ 
https://issues.apache.org/jira/browse/IGNITE-24620?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pavel Tupitsyn updated IGNITE-24620:
------------------------------------
    Labels: .NET LINQ ignite-3 newbie  (was: .NET LINQ ignite-3)

> .NET: LINQ: Inconsistent exceptions in First/Single when result count is 
> unexpected
> -----------------------------------------------------------------------------------
>
>                 Key: IGNITE-24620
>                 URL: https://issues.apache.org/jira/browse/IGNITE-24620
>             Project: Ignite
>          Issue Type: Bug
>          Components: platforms, thin client
>    Affects Versions: 3.0
>            Reporter: Pavel Tupitsyn
>            Assignee: Pavel Tupitsyn
>            Priority: Trivial
>              Labels: .NET, LINQ, ignite-3, newbie
>
> Reproducer:
> {code}
> 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>();
> view.AsQueryable().First();
> {code}
> Exception:
> {code}
> System.InvalidOperationException : ResultSet is empty: select _T0.ID, 
> _T0.NAME from PUBLIC.FOO as _T0 limit 1
>    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
>  171
>    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
>  174
>    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}
> Expected exception:
> {code}
> System.InvalidOperationException : Sequence contains no elements
> {code}
> Expected exception for Single when there is more than 1:
> {code}
> System.InvalidOperationException : Sequence contains more than one element
> {code}
> Those exceptions are standard for LINQ and familiar to developers, we should 
> not invent our own.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to