[VECTOR_FLOAT16] Implement feature extension and version negotiation for Vector v2 support#2868
[VECTOR_FLOAT16] Implement feature extension and version negotiation for Vector v2 support#2868muskan124947 wants to merge 8 commits intomainfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2868 +/- ##
============================================
- Coverage 59.23% 59.20% -0.04%
- Complexity 4797 4809 +12
============================================
Files 151 151
Lines 34781 34825 +44
Branches 5829 5834 +5
============================================
+ Hits 20604 20618 +14
- Misses 11380 11416 +36
+ Partials 2797 2791 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
This PR extends the Microsoft SQL Server JDBC driver’s vector feature support to introduce an explicit vectorTypeSupport version model, including v2 (float32 + float16) and client–server negotiation of supported vector versions.
Changes:
- Introduces a
VectorTypeSupportenum and TDS constants for vector feature extension, wiring them into connection properties and feature negotiation during login. - Adds client–server vector version negotiation in
SQLServerConnection, with a trackednegotiatedVectorVersionand a getter, and updates resource strings and public APIs (ISQLServerConnection,ISQLServerDataSource, pool proxy) to document v2 support. - Updates tests and helpers (e.g.,
VectorTestand property metadata) to recognize"v2"as a validvectorTypeSupportvalue and to support float16-specific behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDriver.java |
Adds VectorTypeSupport enum mapping logical values to TDS versions, updates the vectorTypeSupport driver property default, and exposes the allowed values via SQLServerDriverPropertyInfo for configuration tooling. |
src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java |
Reworks vector-type configuration to use VectorTypeSupport, adds negotiatedVectorVersion state, integrates vector version negotiation into feature extension ACK handling, and exposes getNegotiatedVectorVersion(). |
src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java |
Extends TDS constants for vector support to define explicit v1 and v2 values and updates the maximum supported version to 2. |
src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java |
Updates resource strings for vectorTypeSupport to document the new valid value "v2" and keep error messages aligned with the property’s semantics. |
src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerConnection.java |
Updates the setVectorTypeSupport / getVectorTypeSupport Javadoc to describe v2, aligning the public connection interface with the extended vector support options. |
src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataSource.java |
Mirrors the vectorTypeSupport documentation updates on the DataSource API to include v2 and clarify behavior. |
src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionPoolProxy.java |
Propagates and documents the extended vectorTypeSupport property through the pooled connection proxy. |
src/test/java/com/microsoft/sqlserver/jdbc/datatypes/VectorTest.java |
Extends the test helper connection factory to accept "v2" as a valid vectorTypeSupport value while otherwise preserving existing vector behavior tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDriver.java
Outdated
Show resolved
Hide resolved
src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java
Outdated
Show resolved
Hide resolved
src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private byte negotiateVectorVersion(VectorTypeSupport clientVectorSupportEnum, byte serverVersion) { | ||
|
|
||
| // If server doesn't support vectors, negotiation is off | ||
| if (serverVersion == TDS.VECTORSUPPORT_NOT_SUPPORTED) { | ||
| return TDS.VECTORSUPPORT_NOT_SUPPORTED; | ||
| } | ||
|
|
||
| if (clientVectorSupportEnum == VectorTypeSupport.OFF) { | ||
| return TDS.VECTORSUPPORT_NOT_SUPPORTED; | ||
| } | ||
|
|
||
| byte clientMaxVersion = clientVectorSupportEnum.getTdsValue(); | ||
|
|
||
| // Negotiate using the minimum supported version | ||
| return (byte) Math.min(clientMaxVersion, serverVersion); |
There was a problem hiding this comment.
The new negotiateVectorVersion logic introduces non-trivial behavior (e.g., handling client OFF vs. server NOT_SUPPORTED, client V2 vs. server V1, etc.), but there do not appear to be tests that directly validate these negotiation outcomes or the negotiatedVectorVersion field. Given that other SQLServerConnection behaviors are covered by tests (for example, see RequestBoundaryMethodsTest.setConnectionFields / compareValuesAgainstConnection), consider adding targeted tests that exercise this negotiation for the key combinations of client and server versions to guard against regressions.
Description
For upcoming VECTOR_FLOAT16 support in the Microsoft JDBC Driver for SQL Server, this PR introduces the initial framework for vector type support handling on the client side, enabling controlled negotiation of vector capabilities between client and server.
The changes focus on making vector support explicit, extensible, and future-proof, in preparation for additional vector versions and data types.
Vector Version Negotiation Flow
Impact