Skip to content

IGNITE-18084 .NET: LINQ: Async materialization#1495

Merged
ptupitsyn merged 106 commits into
apache:mainfrom
ptupitsyn:ignite-18084
Jan 5, 2023
Merged

IGNITE-18084 .NET: LINQ: Async materialization#1495
ptupitsyn merged 106 commits into
apache:mainfrom
ptupitsyn:ignite-18084

Conversation

@ptupitsyn

@ptupitsyn ptupitsyn commented Jan 4, 2023

Copy link
Copy Markdown
Contributor

Add methods to materialize LINQ results (execute query and fetch rows) asynchronously.

Standard System.Linq.Queryable provides only synchronous methods to retrieve results: ToList, First, Count, etc. However, underlying Ignite SQL API is asynchronous, so those built-in methods lead to unnecessary blocking. For every built-in method we provide an async counterpart with the same signature.

Inspired by EF Core EntityFrameworkQueryableExtensions.

Full list of added public APIs:

  • IResultSet.ToDictionaryAsync (works for raw SQL and LINQ)
  • IResultSet.CollectAsync (works for raw SQL and LINQ)
  • IQueryable<T>.AsAsyncEnumerable
  • IQueryable<T>.AnyAsync
  • IQueryable<T>.AllAsync
  • IQueryable<T>.AverageAsync
  • IQueryable<T>.CountAsync
  • IQueryable<T>.LongCountAsync
  • IQueryable<T>.FirstAsync
  • IQueryable<T>.FirstOrDefaultAsync
  • IQueryable<T>.SingleAsync
  • IQueryable<T>.SingleOrDerfaultAsync
  • IQueryable<T>.MinAsync
  • IQueryable<T>.MaxAsync
  • IQueryable<T>.SumAsync
  • IQueryable<T>.ToListAsync
  • IQueryable<T>.DictionaryAsync
  • IQueryable<T>.ToQueryString

@ptupitsyn ptupitsyn self-assigned this Jan 4, 2023

@isapego isapego left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. Left one minor comment.

Comment thread modules/platforms/dotnet/Apache.Ignite/Sql/IResultSet.cs Outdated
ptupitsyn and others added 2 commits January 5, 2023 10:28
Co-authored-by: Igor Sapego <isapego@apache.org>
@ptupitsyn
ptupitsyn merged commit e025f0d into apache:main Jan 5, 2023
@ptupitsyn
ptupitsyn deleted the ignite-18084 branch January 5, 2023 08:14
maxzhuravkov pushed a commit to gridgain/apache-ignite-3 that referenced this pull request Mar 18, 2023
Add methods to materialize LINQ results (execute query and fetch rows) asynchronously. 

Standard `System.Linq.Queryable` provides only synchronous methods to retrieve results: `ToList`, `First`, `Count`, etc. However, underlying Ignite SQL API is asynchronous, so those built-in methods lead to unnecessary blocking. For every built-in method we provide an async counterpart with the same signature.

Inspired by EF Core [EntityFrameworkQueryableExtensions](https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.entityframeworkqueryableextensions?view=efcore-7.0).

Full list of added public APIs:
* `IResultSet.ToDictionaryAsync` (works for raw SQL and LINQ)
* `IResultSet.CollectAsync` (works for raw SQL and LINQ)
* `IQueryable<T>.AsAsyncEnumerable`
* `IQueryable<T>.AnyAsync`
* `IQueryable<T>.AllAsync`
* `IQueryable<T>.AverageAsync`
* `IQueryable<T>.CountAsync`
* `IQueryable<T>.LongCountAsync`
* `IQueryable<T>.FirstAsync`
* `IQueryable<T>.FirstOrDefaultAsync`
* `IQueryable<T>.SingleAsync`
* `IQueryable<T>.SingleOrDerfaultAsync`
* `IQueryable<T>.MinAsync`
* `IQueryable<T>.MaxAsync`
* `IQueryable<T>.SumAsync`
* `IQueryable<T>.ToListAsync`
* `IQueryable<T>.DictionaryAsync`
* `IQueryable<T>.ToQueryString`
maxzhuravkov pushed a commit to gridgain/apache-ignite-3 that referenced this pull request Apr 19, 2023
Add methods to materialize LINQ results (execute query and fetch rows) asynchronously. 

Standard `System.Linq.Queryable` provides only synchronous methods to retrieve results: `ToList`, `First`, `Count`, etc. However, underlying Ignite SQL API is asynchronous, so those built-in methods lead to unnecessary blocking. For every built-in method we provide an async counterpart with the same signature.

Inspired by EF Core [EntityFrameworkQueryableExtensions](https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.entityframeworkqueryableextensions?view=efcore-7.0).

Full list of added public APIs:
* `IResultSet.ToDictionaryAsync` (works for raw SQL and LINQ)
* `IResultSet.CollectAsync` (works for raw SQL and LINQ)
* `IQueryable<T>.AsAsyncEnumerable`
* `IQueryable<T>.AnyAsync`
* `IQueryable<T>.AllAsync`
* `IQueryable<T>.AverageAsync`
* `IQueryable<T>.CountAsync`
* `IQueryable<T>.LongCountAsync`
* `IQueryable<T>.FirstAsync`
* `IQueryable<T>.FirstOrDefaultAsync`
* `IQueryable<T>.SingleAsync`
* `IQueryable<T>.SingleOrDerfaultAsync`
* `IQueryable<T>.MinAsync`
* `IQueryable<T>.MaxAsync`
* `IQueryable<T>.SumAsync`
* `IQueryable<T>.ToListAsync`
* `IQueryable<T>.DictionaryAsync`
* `IQueryable<T>.ToQueryString`
isapego pushed a commit to isapego/ignite-3 that referenced this pull request Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants