Skip to content

Conversation

@muskan124947
Copy link
Contributor

@muskan124947 muskan124947 commented Dec 22, 2025

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

  • The client vector setting is parsed and validated:
off – vector support disabled
v1 – float32 vector support
v2 – float32 and float16 vector support
  • If either the client disables vectors or the server does not support vectors, vector support is disabled.
  • The client and server determine their maximum supported vector versions.
  • When both support vectors, the negotiated version is the minimum of the client and server versions.
  • The negotiated version is used for all vector-related operations for the connection.

Impact

  • Backward compatibility: Clients using only float32 continue to work without changes.
  • Performance: Float16 support reduces memory usage and network payload for supported operations.
  • Extensibility: Framework allows easy addition of future vector types and versions.

@muskan124947 muskan124947 self-assigned this Dec 22, 2025
@codecov
Copy link

codecov bot commented Dec 22, 2025

Codecov Report

❌ Patch coverage is 46.93878% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.47%. Comparing base (303aeb9) to head (f2aa7ce).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../microsoft/sqlserver/jdbc/SQLServerConnection.java 46.15% 10 Missing and 4 partials ⚠️
.../com/microsoft/sqlserver/jdbc/SQLServerDriver.java 47.82% 12 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2868      +/-   ##
============================================
+ Coverage     56.44%   56.47%   +0.02%     
- Complexity     4559     4574      +15     
============================================
  Files           151      151              
  Lines         34560    34604      +44     
  Branches       5768     5774       +6     
============================================
+ Hits          19508    19542      +34     
- Misses        12418    12439      +21     
+ Partials       2634     2623      -11     

☔ 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.

@muskan124947
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

* @param serverVersion The server's supported vector version
* @return The negotiated vector version
*/
private byte negotiateVectorVersion(String clientVectorSupport, byte serverVersion) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should check and validate connection string value for vectorSupport option as a string only once and then map it to an enum value and use it everywhere instead of string values.

When we send the vector FE to server as part of pre-login, we should compare the connection string value of vectorSupport and driver's current vector version, do the min of it and send that to server. This simplifies trhe negoation.

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