Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-3614

Can't use SOUNDEX function in WHERE clause, but can in MariaDB/MySQL

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Cannot Reproduce
    • 1.2.5
    • 5.5.1
    • N/A
    • None
    • Columnstore 1.2.5-1 running on Windows 10 WSL, single server setup

    Description

      The SOUNDEX function works in the WHERE clause in standard MariaDB and examples that would fail in MariaDB Columnstore are included in MariaDB's documentation, for example:
      https://mariadb.com/kb/en/library/soundex/

      The following example on that page would fail in MariaDB Columnstore:
      SELECT givenname, surname FROM users WHERE SOUNDEX(givenname) = SOUNDEX("robert");

      The error returned is:
      ERROR 1815 (HY000): Internal error: IDB-1001: Function 'soundex' can only be used in the outermost select or order by clause and cannot be used in conjunction with an aggregate function.

      This is not the only function that returns a string which for whatever reason cannot be used anywhere in a query other than the outermost select list or order by clause, despite such being usable in the where clause of standard MariaDB or most other databases. It is unclear to me what the cause is, whether this is intentional, why it would be intentional if it is intentional, etc. Comparing the similarity of strings is a fairly common requirement.

      A work-around for SOUNDEX would be to create copies of tables holding the SOUNDEX values for columns of interest, and joining on the stored results, however custom functions calculating similarity between two strings of text such as Jaro Winkler (https://github.com/fza/mysql-doctrine-jaro-winkler-function) fail to work in the where clause as well, and return the same error previously mentioned. No workaround can be put together in that case because the similarity of text on two columns of rows on two different tables cannot be filtered based on their degree of similarity.

      Thank you for any insight you can provide.

      Attachments

        Activity

          People

            toddstoffel Todd Stoffel (Inactive)
            briandemilia Brian DeMilia
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.