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

Feature Request: Add Sum Aggregation and Column-Wise Multiplication for Sparse Vectors #475

Open
Barabanga opened this issue May 10, 2024 · 4 comments

Comments

@Barabanga
Copy link

Starting off, we'd like to express our appreciacion for the project.

Integrating the following operations for sparse vectors would be of great use to our use case:

  • An aggregate sum operation for sparse vectors, similar to the one already implemented for dense vectors.
  • Element-wise multiplication.

By incorporating these functionalities, we can streamline computations directly within the database, sparing us the overhead of loading them into our application.

Thank you for considering this request.

@VoVAllen
Copy link
Member

Thanks for your interest! May I ask what's your scenario to do the aggregate sum for sparse vectors? What's the query looks like?

@VoVAllen
Copy link
Member

And what's Column-Wise Multiplication? Do you mean dot product between sparse vectors?

@Barabanga
Copy link
Author

Thanks for your interest! May I ask what's your scenario to do the aggregate sum for sparse vectors? What's the query looks like?

We utilize a sparse vector as a bag-of-words representation for a set of documents. In this representation, each dimension in the sparse vector denotes a term, while the value indicates its frequency within a given document. By using the sum aggregation, we would be able to easily compute some statistics about the collection.
For example
select sum(term_frequencies) from documents;
would result in the total term frequencies for each term.

And what's Column-Wise Multiplication? Do you mean dot product between sparse vectors?

My bad, I meant element-wise multiplication, not column-wise.
For example [1, 2, 3] * [1, 2, 3] = [1, 4, 9] (for both dense and sparse vectors)

@VoVAllen
Copy link
Member

Understand! PRs on the way

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

No branches or pull requests

2 participants