I want to convert a string of max length 15 to a unique long number. I am trying to use BigInteger's longValue() function for the same.
BigInteger bigInt = new BigInteger("abcdeabcdeabcda".getBytes());
long n = bigInt.longValue();
- Can we avoid collision of long value until 15 chars of String?
- String can contain alphanumeric including special character.
- The idea not to encrypt the string to long. But to improve the performance of count(distinct) of hive queries.
- We note that count(distinct) in hive provides good performance if long is used instead of string.
- We don't want approx. or probablistic count distinct. We want exact count distinct.
Thanks in Advance