Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Introduce SqlVectorFloat32 SqlType class for vector datatype support#3433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

apoorvdeshmukh
Copy link
Contributor

Description

Adds Vector datatype support for Float32 with Sqltype SqlVectorFloat32

Design Considerations

  • Some inputs have been considered from📢 Proposal: Introducing SqlType `SqlVectorFloat32` for SQL Server's New VECTOR Data Type #3382
  • Between a generic class definition SqlVector and concrete type SqlVectorFloat32, after comparison it was decided to use concrete types.
  • In future we may consider using SqlVector as base class to isolate common functionality between different Vector types but the public API surface will continue to use concrete definitions so that developers know the exact supported type they are working with.
  • SqlVectorFloat32 will be encouraged as the only way to work with Float32 vector data when using SqlDbType enum value for Vector.
  • Output parameters for reading SqlVectorFloat32 return value will be initialized through SqlVectorFloat32(n) constructor for SqlParameter.Value to allow users to correctly specify the size and type for the vector data they expect to read.

Issues

Closes#3317

Testing

Tests are split into three categories
Unit Tests for SqlVectorFloat32 under SqlVectorFloat32Tests.cs
Backward Compatibility Test Suite to validate behavior when exchanging vector data as varchar(max)
Native Vector Support Test Suite highlighting the supported functionality

edwardneal reacted with rocket emoji
This commit adds feature extension for vector datatype support.Additionally, GenericTDSServer has been enhanced to enable teststo validate login requests and response for the vector feature extension.Tests have been added under SqlConnectionBasicTests throughTestConnWithVectorFeatExtVersionNegotiation.
@CopilotCopilotAI review requested due to automatic review settingsJune 19, 2025 10:06
@apoorvdeshmukhapoorvdeshmukh requested a review froma team as acode ownerJune 19, 2025 10:06
@apoorvdeshmukhapoorvdeshmukh marked this pull request as draftJune 19, 2025 10:06
Copy link
Contributor

@CopilotCopilotAI 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 introduces support for vector datatypes with a concrete SqlVectorFloat32 class that encapsulates 32‐bit float vector data. Key changes include the addition of the SqlVectorFloat32 type and its handling through TDS feature extensions, updates to resource strings and error messages, and comprehensive tests verifying the new functionality.

Reviewed Changes

Copilot reviewed 36 out of 38 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS/TDSFeatureID.csAdded enum constant VectorSupport for TDS features.
src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.Servers/*Extended server session and login logic to negotiate and enable vector support.
src/Microsoft.Data.SqlClient/tests/*Added new tests and updated project files for SqlVectorFloat32.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlTypes/SqlVectorFloat32.csIntroduced the new type for float vector data with constructors, properties, and serialization to JSON.
Various source files (SqlDbTypeExtensions.cs, TdsEnums.cs, SqlParameter.cs, SqlBuffer.cs, etc.)Updated handling, type mappings, and protocol communication to support vector datatype.
Documentation filesUpdated XML documentation and resource strings for vector support.
Files not reviewed (1)
  • src/Microsoft.Data.SqlClient/src/Resources/Strings.Designer.cs: Language not supported
Comments suppressed due to low confidence (1)

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlTypes/SqlVectorFloat32.cs:116

  • [nitpick] Consider ensuring consistent indentation for the NETCORE branch to improve code readability.
        ReadOnlySpan<byte> dataSpan = _rawBytes.AsSpan(8, elementCount * sizeof(float));

@apoorvdeshmukhapoorvdeshmukh added this to the6.1-preview2 milestoneJun 19, 2025
@apoorvdeshmukhapoorvdeshmukh added P1Use to label relatively higher severity issues, or issues that impact a large number of customers. Area\VectorUse this for issues that are targeted for the Vector feature in the driver. P2Use to label moderate priority issue - impacts atleast more than 1 customer. and removed P1Use to label relatively higher severity issues, or issues that impact a large number of customers. P2Use to label moderate priority issue - impacts atleast more than 1 customer. labelsJun 19, 2025
@apoorvdeshmukhapoorvdeshmukh marked this pull request as ready for reviewJune 20, 2025 16:16
@codecovCodecov
Copy link

codecovbot commentedJun 20, 2025
edited
Loading

Codecov Report

Attention: Patch coverage is34.00000% with198 lines in your changes missing coverage. Please review.

Project coverage is 60.17%. Comparing base(27ab95a) to head(897a6f6).
Report is 3 commits behind head on main.

Files with missing linesPatch %Lines
.../netcore/src/Microsoft/Data/SqlClient/TdsParser.cs15.68%43 Missing⚠️
...nt/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs15.68%43 Missing⚠️
...nt/src/Microsoft/Data/SqlTypes/SqlVectorFloat32.cs56.71%29 Missing⚠️
...qlClient/src/Microsoft/Data/SqlClient/SqlBuffer.cs28.57%25 Missing⚠️
...lient/src/Microsoft/Data/SqlClient/SqlParameter.cs33.33%18 Missing⚠️
...ient/src/Microsoft/Data/SqlClient/SqlDataReader.cs17.64%14 Missing⚠️
...SqlClient/src/Microsoft/Data/SqlClient/SqlEnums.cs33.33%6 Missing⚠️
...netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs20.00%4 Missing⚠️
...t/netfx/src/Microsoft/Data/SqlClient/SqlCommand.cs20.00%4 Missing⚠️
...SqlClient/src/Microsoft/Data/Common/AdapterUtil.cs20.00%4 Missing⚠️
... and4 more

❗ There is a different number of reports uploaded between BASE (27ab95a) and HEAD (897a6f6). Click for more details.

HEAD has 1 upload less than BASE
FlagBASE (27ab95a)HEAD (897a6f6)
addons10
Additional details and impacted files
@@            Coverage Diff             @@##             main    #3433      +/-   ##==========================================- Coverage   69.11%   60.17%   -8.95%==========================================  Files         280      275       -5       Lines       62128    62209      +81     ==========================================- Hits        42942    37434    -5508- Misses      19186    24775    +5589
FlagCoverage Δ
addons?
netcore63.36% <34.80%> (-9.65%)⬇️
netfx62.22% <35.21%> (-6.06%)⬇️

Flags with carried forward coverage won't be shown.Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@paulmedynskipaulmedynski left a comment

Choose a reason for hiding this comment

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

I have reviewed all of the implementation except SqlVectorFloat32. I'll wait to review that once you make the changes we discussed on Friday.

I will look at the tests after that.

Copy link
Contributor

@edwardnealedwardneal left a comment

Choose a reason for hiding this comment

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

Thanks for opening the earlier discussion. I've added a few comments, but the overall API surface looks good to me.

@apoorvdeshmukhapoorvdeshmukh merged commitfc950e8 intodotnet:mainJun 25, 2025
237 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@edwardnealedwardnealedwardneal left review comments

@samsharma2700samsharma2700samsharma2700 left review comments

Copilot code reviewCopilotCopilot left review comments

@cheenamalhotracheenamalhotracheenamalhotra approved these changes

@paulmedynskipaulmedynskipaulmedynski approved these changes

Assignees
No one assigned
Labels
Area\VectorUse this for issues that are targeted for the Vector feature in the driver.P1Use to label relatively higher severity issues, or issues that impact a large number of customers.
Projects
None yet
Milestone
6.1-preview2
Development

Successfully merging this pull request may close these issues.

Native Vector datatype support
5 participants
@apoorvdeshmukh@cheenamalhotra@paulmedynski@edwardneal@samsharma2700

[8]ページ先頭

©2009-2025 Movatter.jp