user2518751
user2518751

Reputation: 735

In Hive, how do I find the number of differences between 2 columns?

I'm trying to find the number of differences when comparing two columns. For example:

Column 1: 'ABCDEFGH!' Column 2: 'aBcDSfGh?'

Number of differences is 6.

How can I achieve such thing in Hive?

Upvotes: 0

Views: 271

Answers (1)

user8143344
user8143344

Reputation:

You can use Levenshtein distance function

select levenshtein(column1, column2) from table

Upvotes: 1

Related Questions