Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Providingmethod sourcedocument #2676

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

vincent-4
Copy link
Contributor

Changes made:

  1. Added vector() method to SourceDocument interface as an optional default method that returns float[] for direct vector access

  2. Implemented vector() in collection classes:

    • JsonDenseVectorCollection: Returns parsed vector for array format
    • JsonVectorCollection: Returns vector for dense format, null for sparse
  3. Modified document generators to use direct vector access:

    • Try vector() first
    • Fall back to string parsing for backward compatibility
    • Affects: JsonDenseVectorDocumentGenerator, JsonInvertedDenseVectorDocumentGenerator
  4. Added vector validation in tests:

    • Added helper method validateVectorIfPresent in JsonVectorCollectionTest
    • Verifies correct vector parsing and null handling
    • Tests both array and non-array formats

Addresses: #2661

@lintool
Copy link
Member

lintool commented Jan 12, 2025

@vincent-4 I think it's okay to deprecate the string parsing methods? I.e., remove completely. Once this is in a reasonable state I will verify regressions - there's no need/reason to keep the jank around...

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.

2 participants