IGNITE-27068 .NET: LINQ: Support C# 14 span methods#7933
IGNITE-27068 .NET: LINQ: Support C# 14 span methods#7933gurustron merged 9 commits intoapache:mainfrom
Conversation
|
It is not possible to test this with .NET 8 SDK/runtime (C# 14 is needed). The added test does not actually do anything, testing was done in a separate branch with a separate project - gurustron@8d6d21a#diff-59756034c51e3f354b27eb11ce2a4611a1de92d3e29c726bebafc34114a31603 |
There was a problem hiding this comment.
Pull request overview
This PR updates the .NET LINQ query parser to handle C# 14 “first-class span” Contains calls by rewriting MemoryExtensions.Contains(ReadOnlySpan<T>, T) into Enumerable.Contains(IEnumerable<T>, T) so existing LINQ-to-SQL translation can produce IN (...) SQL.
Changes:
- Register a custom Remotion LINQ expression transformer to rewrite
MemoryExtensions.Containscalls. - Add a custom evaluatable-expression filter to prevent partial evaluation of
ReadOnlySpan<T>implicit conversions. - Add a LINQ SQL generation test related to
Contains.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| modules/platforms/dotnet/Apache.Ignite/Internal/Linq/IgniteQueryParser.cs | Adds an expression transformer + evaluatable-expression filter to support span-based Contains in LINQ parsing. |
| modules/platforms/dotnet/Apache.Ignite.Tests/Linq/LinqSqlGenerationTests.cs | Adds a SQL generation test for Contains producing an IN expression. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
modules/platforms/dotnet/Apache.Ignite/Internal/Linq/IgniteQueryParser.cs
Outdated
Show resolved
Hide resolved
modules/platforms/dotnet/Apache.Ignite/Internal/Linq/IgniteQueryParser.cs
Show resolved
Hide resolved
modules/platforms/dotnet/Apache.Ignite/Internal/Linq/IgniteQueryParser.cs
Outdated
Show resolved
Hide resolved
modules/platforms/dotnet/Apache.Ignite/Internal/Linq/IgniteQueryParser.cs
Show resolved
Hide resolved
modules/platforms/dotnet/Apache.Ignite.Tests/Linq/LinqSqlGenerationTests.cs
Show resolved
Hide resolved
ptupitsyn
left a comment
There was a problem hiding this comment.
Looks good to me in general, please see a few minor comments.
modules/platforms/dotnet/Apache.Ignite/Internal/Linq/IgniteQueryParser.cs
Outdated
Show resolved
Hide resolved
modules/platforms/dotnet/Apache.Ignite/Internal/Linq/IgniteQueryParser.cs
Outdated
Show resolved
Hide resolved
modules/platforms/dotnet/Apache.Ignite/Internal/Linq/IgniteQueryParser.cs
Show resolved
Hide resolved
…ryParser.cs Co-authored-by: Pavel Tupitsyn <ptupitsyn@apache.org>
…ryParser.cs Co-authored-by: Pavel Tupitsyn <ptupitsyn@apache.org>
Thank you for submitting the pull request.
To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:
The Review Checklist
- There is a single JIRA ticket related to the pull request.
- The web-link to the pull request is attached to the JIRA ticket.
- The JIRA ticket has the Patch Available state.
- The description of the JIRA ticket explains WHAT was made, WHY and HOW.
- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
Notes