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

Add New Vector Functions #5120

Open
19 of 21 tasks
zhongzc opened this issue Dec 9, 2024 · 14 comments
Open
19 of 21 tasks

Add New Vector Functions #5120

zhongzc opened this issue Dec 9, 2024 · 14 comments
Labels
C-feature Category Features good first issue Good for newcomers tracking-issue A tracking issue for a feature.

Comments

@zhongzc
Copy link
Contributor

zhongzc commented Dec 9, 2024

What problem does the new feature solve?

We seek external contributors to help us implement various functions for vector operations in GreptimeDB. You can refer to this PR as a guide for implementing vec_scalar_add. Below is a list of functions we are considering. Each function comes with a brief description.

Please respond below with the function(s) you would like to contribute, ensuring to avoid overlap with other contributors. We look forward to your valuable contributions!

What does the feature do?

Vector Basic Functions:

Vector Properties/Access Functions:

Conversion Functions (JSON <-> Vector):

  • JSON_TO_VEC: Converts a JSON Array to a Vector.
  • VEC_TO_JSON: Converts a Vector to a JSON Array.

Conversion Functions (String <-> Vector):

Vector Distance Functions:

... Other possible functions

Implementation challenges

No response

@zhongzc zhongzc added good first issue Good for newcomers C-feature Category Features labels Dec 9, 2024
@killme2008 killme2008 added the tracking-issue A tracking issue for a feature. label Dec 9, 2024
@linyihai
Copy link
Contributor

I'd look into VEC_SCALAR_MUL(f32, vec) :)

@wty4427300
Copy link

I want to try VEC_ADD(vec0, vec1):

@killme2008
Copy link
Contributor

I'd look into VEC_SCALAR_MUL(f32, vec) :)

Cool, thank you!

@killme2008
Copy link
Contributor

I want to try VEC_ADD(vec0, vec1):

Thanks!

@linyihai
Copy link
Contributor

I'd like to implement VEC_DIV(vec0, vec1) also due to it very similar to vec_mul.

@zhongzc
Copy link
Contributor Author

zhongzc commented Jan 9, 2025

I want to try VEC_ADD(vec0, vec1):

@wty4427300 Is there any progress regarding the implementation of vec_add?

@killme2008
Copy link
Contributor

@zhongzc We need to update the functions doc

https://docs.greptime.com/reference/sql/functions/vector/

@lyang24
Copy link
Collaborator

lyang24 commented Feb 7, 2025

Hi I want to work on vec to and from json. Do you think we can reuse ParseVectorFunction for json to vec or its better to create a separate function?

@xiaoniaoyouhuajiang
Copy link
Contributor

I'd look into VEC_DIM(vec) :)

@Pikady
Copy link
Contributor

Pikady commented Mar 7, 2025

I'd look into VEC_KTH_ELEM(vec, k).

@SNC123
Copy link
Contributor

SNC123 commented Mar 8, 2025

I'd look into VEC_SUBVECTOR(vec, start, end). Would it be okay for me to give it a try?

@kche0169
Copy link

Hi I want to work on vec to and from json. Do you think we can reuse ParseVectorFunction for json to vec or its better to create a separate function?

Hi, I was wondering if you're still working on this feature. If you're not planning to continue, I’d be happy to give it a try.

@lyang24
Copy link
Collaborator

lyang24 commented Mar 23, 2025

Hi I want to work on vec to and from json. Do you think we can reuse ParseVectorFunction for json to vec or its better to create a separate function?

Hi, I was wondering if you're still working on this feature. If you're not planning to continue, I’d be happy to give it a try.

Please take it.

@kche0169
Copy link

Hi I want to work on vec to and from json. Do you think we can reuse ParseVectorFunction for json to vec or its better to create a separate function?

Hi, I was wondering if you're still working on this feature. If you're not planning to continue, I’d be happy to give it a try.

Please take it.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category Features good first issue Good for newcomers tracking-issue A tracking issue for a feature.
Projects
None yet
Development

No branches or pull requests

9 participants