Skip to content

[Bug]: DataTable search generates a bad call to DuckDB's jaccard for null and/or empty strings #3167

@vrmiguel

Description

@vrmiguel

Describe the bug

Query.js runs jaccard here:

const similarity = taggedSql`jaccard(lower('${escapedSearchTerm}'), lower("${col}"))`;

When searching a column with null and empty strings, I get no search results, and this error logged:

Image

From DuckDB's code I can see that this error will pop up if any argument to jaccard is an empty string.

D SELECT jaccard('test', '');
Invalid Input Error:
Jaccard Function: An argument too short!

Query.js will have to be updated to not send empty strings to jaccard

Steps to Reproduce

Search on a DataTable with a column that contains empty string and/or nulls as values

Logs

System Info

Severity

serious, but I can work around it

Additional Information, or Workarounds

COALESCE + NULLIF to change nulls and empty strings into something else

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingto-reviewEvidence team to review

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions