Github user set0gut1 commented on the pull request:
https://github.com/apache/spark/pull/4650#issuecomment-154509562
```scala
def gethash(in:String):Long = {
var h = 1125899906842597L
for (x <- in) {
h = 31 * h + x;
}
return h
}
```
This hash function seems to be weak.
I tried this with subject URIs of DBpedia's `labels_en.nt`
([sample](http://downloads.dbpedia.org/preview.php?file=2015-04_sl_core-i18n_sl_en_sl_labels_en.nt.bz2)).
There are 11,519,154 unique URIs, and the hash values of 20,741 URIs
collided (0.18%).
For example, the hash values of these URI are same (-3127496886112549146).
* `http://dbpedia.org/resource/Dms`
* `http://dbpedia.org/resource/EOT`
* `http://dbpedia.org/resource/F15`
* `http://dbpedia.org/resource/EP5`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]