-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 array_dot_product
/ list_dot_product
function
#12476
Conversation
Signed-off-by: Austin Liu <austin362667@gmail.com>
Signed-off-by: Austin Liu <austin362667@gmail.com>
Signed-off-by: Austin Liu <austin362667@gmail.com>
Signed-off-by: Austin Liu <austin362667@gmail.com>
Hey @austin362667 Maybe you should take a look at this discussion #12357 once |
Thank you, @dharanad , for bringing this to my attention. This is a great discussion. I like the idea of keeping the DataFusion core as simple as possible while retaining useful DuckDB functions that enhance the user experience. I'm open to any feedback~ |
What would you think about creating a new crate in https://github.com/datafusion-contrib to hold additional duckdb functions? Perhaps https://github.com/datafusion-contrib/datafusion-functions-duckdb, similar to https://github.com/datafusion-contrib/datafusion-functions-json for JSON from @samuelcolvin and co. It would be a pretty neat way to help build out the function library in DataFUsion Also, @matthewmturner and I have been working on an integration UI similar to |
Sure, thank you Andrew for proposing this initiative. |
Awesome -- let's try a new repo. Follow on discussion here: #12254 (comment) |
Which issue does this PR close?
Closes #12475.
Rationale for this change
Add dot product functionality to DataFusion. It would be valuable to add scalar UDF
array_dot_product
/list_dot_product
which computes inner product of two arrays, that is already supported by well-known DBs like DuckDB.What changes are included in this PR?
convert_to_f64_array
tofunctions-nested/utils.rs
.array_dot_product
/list_dot_product
infunctions-nested
.array.slt
.Are these changes tested?
Yes, added some array-specific SQL logic test, including
List
/LargeList
/FixedSizedList
Are there any user-facing changes?
Yes, new function
array_dot_product(arr1, arr2)
is added.For instance,