-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Feature] Implement cosine_similarity array function #60403
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
base: master
Are you sure you want to change the base?
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Co-authored-by: zclllyybb <[email protected]>
Co-authored-by: zclllyybb <[email protected]>
|
run buildall |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
TPC-H: Total hot run time: 31615 ms |
ClickBench: Total hot run time: 28.07 s |
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
FE Regression Coverage ReportIncrement line coverage |
|
PR approved by anyone and no changes requested. |
Implements
cosine_similarityarray function following DuckDB semantics. The function computes the cosine similarity between two float arrays:dot(x, y) / (||x|| * ||y||).Changes
Backend (C++)
CosineSimilarityclass infunction_array_distance.hfunction_array_distance.cppusing the existingFunctionArrayDistancetemplateFrontend (Java)
CosineSimilarity.javascalar function classScalarFunctionVisitor.javaBuiltinScalarFunctions.javaTests
cosine_distanceUsage
Behavior
ARRAY<FLOAT>of equal lengthFLOATWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
duckdb.org/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.