Skip to content

IGNITE-27068 .NET: LINQ: Support C# 14 span methods#7933

Merged
gurustron merged 9 commits intoapache:mainfrom
gurustron:IGNITE-27068-csharp-14
Apr 6, 2026
Merged

IGNITE-27068 .NET: LINQ: Support C# 14 span methods#7933
gurustron merged 9 commits intoapache:mainfrom
gurustron:IGNITE-27068-csharp-14

Conversation

@gurustron
Copy link
Copy Markdown
Contributor

@gurustron gurustron commented Apr 4, 2026

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

  • Formal criteria: TC status, codestyle, mandatory documentation. Also make sure to complete the following:
    - 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.
  • Design: new code conforms with the design principles of the components it is added to.
  • Patch quality: patch cannot be split into smaller pieces, its size must be reasonable.
  • Code quality: code is clean and readable, necessary developer documentation is added if needed.
  • Tests code quality: test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.

Notes

@gurustron gurustron requested a review from ptupitsyn as a code owner April 4, 2026 13:36
@gurustron
Copy link
Copy Markdown
Contributor Author

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

@gurustron gurustron requested review from Copilot and ptupitsyn and removed request for ptupitsyn April 4, 2026 13:39
@gurustron gurustron self-assigned this Apr 4, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.Contains calls.
  • 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.

@ptupitsyn ptupitsyn changed the title IGNITE-27068 .NET: Thin 3.0: Support in LINQ C# 14 span methods IGNITE-27068 .NET: LINQ: Support C# 14 span methods Apr 6, 2026
Copy link
Copy Markdown
Contributor

@ptupitsyn ptupitsyn left a comment

Choose a reason for hiding this comment

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

Looks good to me in general, please see a few minor comments.

gurustron and others added 2 commits April 6, 2026 10:29
…ryParser.cs

Co-authored-by: Pavel Tupitsyn <ptupitsyn@apache.org>
…ryParser.cs

Co-authored-by: Pavel Tupitsyn <ptupitsyn@apache.org>
@gurustron gurustron merged commit 479eeec into apache:main Apr 6, 2026
5 checks passed
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.

3 participants