Class StringDistanceFunctions.FuzzyScoreFunction

java.lang.Object
org.apache.drill.exec.udfs.StringDistanceFunctions.FuzzyScoreFunction
All Implemented Interfaces:
DrillFunc, DrillSimpleFunc
Enclosing class:
StringDistanceFunctions

public static class StringDistanceFunctions.FuzzyScoreFunction extends Object implements DrillSimpleFunc
This function calculates the cosine distance between two strings. A matching algorithm that is similar to the searching algorithms implemented in editors such as Sublime Text, TextMate, Atom and others.

One point is given for every matched character. Subsequent matches yield two bonus points. A higher score indicates a higher similarity.

Usage: SELECT fuzzy_score( string1, string2 ) AS fuzzy_score FROM...

  • Constructor Details

    • FuzzyScoreFunction

      public FuzzyScoreFunction()
  • Method Details