Skip to content

fix: validate binary vectors in findAndRerank - #2622

Open
erichare wants to merge 3 commits into
mainfrom
fix/find-and-rerank-binary-validation
Open

erichare wants to merge 3 commits into
mainfrom
fix/find-and-rerank-binary-validation

Conversation

@erichare

@erichare erichare commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does:

Validates findAndRerank hybrid-sort $binary vectors during parsing. Malformed Base64, invalid byte lengths, empty vectors, and non-string payloads now return REQUEST_STRUCTURE_MISMATCH errors identifying sort.$hybrid.$vector.$binary. Valid binary vectors and explicit $vector: null retain their existing behavior.

Which issue(s) this PR fixes:
Fixes #2609

Verification

./mvnw -Dtest=FindAndRerankSortClauseDeserializerTest,FindAndRerankBinaryVectorTest test — 44 tests run, 0 failures, 0 errors, 0 skipped; BUILD SUCCESS. Full unit and integration suites were not run.

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

Confirmed RED on main: all nine new malformed binary cases fail, while the 25 existing deserializer cases pass.
Confirmed GREEN: 44 parser and HTTP regression tests pass. Malformed binary values now return REQUEST_STRUCTURE_MISMATCH with the binary field path, and valid binary vectors still decode.
@erichare
erichare requested a review from a team as a code owner October 7, 2026 14:41
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

📈 Unit Test Coverage Delta vs Main Branch

Metric Value
Main Branch 55.07%
This PR 55.20%
Delta 🟢 +0.13%
✅ Coverage improved!

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Unit Test Coverage Report

Overall Project 55.2% 🍏
Files changed 100% 🍏

File Coverage
FindAndRerankSortClauseDeserializer.java 99.52% 🍏

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

📈 Integration Test Coverage Delta vs Main Branch (hcd-it)

Metric Value
Main Branch 73.27%
This PR 74.24%
Delta 🟢 +0.97%
✅ Coverage improved!

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Integration Test Coverage Report (hcd-it)

Overall Project 74.24% -0.04% 🍏
Files changed 0% ❌

File Coverage
FindAndRerankSortClauseDeserializer.java 52.26% -10.69% ❌

@github-actions

Copy link
Copy Markdown
Contributor

📉 Integration Test Coverage Delta vs Main Branch (dse69-it)

Metric Value
Main Branch 73.04%
This PR 73.01%
Delta 🔴 -0.03%
⚠️ Coverage decreased

@github-actions

Copy link
Copy Markdown
Contributor

Integration Test Coverage Report (dse69-it)

Overall Project 73.01% -0.04% 🍏
Files changed 0% ❌

File Coverage
FindAndRerankSortClauseDeserializer.java 52.26% -10.69% ❌

This branch has not been deployed

No deployments
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.

Unclear error message when using $binary vector in findAndRerank

1 participant