[go: nahoru, domu]

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

fixes jaccard bug #417

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fixes jaccard bug
  • Loading branch information
afleisc committed May 29, 2024
commit 59e1adb1fa5a6e4b5d3eb2b18753fb0c34aca90f
4 changes: 2 additions & 2 deletions udfs/community/jaccard.sqlx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ LANGUAGE js AS r"""
const sa = [...new Set(String(a).split(''))]
const sb = [...new Set(String(b).split(''))]

const la = (sa.length > sb.length) ? sa.length : sb.length
const lb = (sa.length > sb.length) ? sb.length : sa.length
const la = sa.length;
const lb = sb.length;

for(let i = 0; i < la; i++) {
for(let j = 0; j < lb; j++) {
Expand Down
4 changes: 4 additions & 0 deletions udfs/community/test_cases.js
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,10 @@ generate_udf_test("jaccard", [
inputs: [`"edge case"`, `"no match"`],
expected_output: `CAST(0.25 AS FLOAT64)`
},
{
inputs: [`"12"`, `"123"`],
expected_output: `CAST(0.67 AS FLOAT64)`
},
]);
generate_udf_test("knots_to_mph", [
{
Expand Down
Loading