Convert String containing letters to Int efficiently - Apache Spark
If you just want any matchable String to an int - String.hashCode(). However you will have to deal with possible hash collisions. Alternatively you'd have to convert each character to its int value and append (not add) all of these together.
I am working with a dataset that has users as Strings (ie. B000GKXY4S). I would like to convert each of these users to int, so I can use  Rating(user: Int, product: Int, rating: Double) class in Apache Spark ALS. What is the most efficient way to do this? Preferably using Spark Scala functions or python native functions.