{"action":"closed","issue":{"url":"https://api.github.com/repos/nerdammer/spark-hbase-connector/issues/13","labels_url":"https://api.github.com/repos/nerdammer/spark-hbase-connector/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/nerdammer/spark-hbase-connector/issues/13/comments","events_url":"https://api.github.com/repos/nerdammer/spark-hbase-connector/issues/13/events","html_url":"https://github.com/nerdammer/spark-hbase-connector/issues/13","id":108283590,"number":13,"title":"ArrayIndexOutOfBoundsException when using HashSaltingProvider","user":{"login":"AlexPerrot","id":2419665,"avatar_url":"https://avatars.githubusercontent.com/u/2419665?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexPerrot","html_url":"https://github.com/AlexPerrot","followers_url":"https://api.github.com/users/AlexPerrot/followers","following_url":"https://api.github.com/users/AlexPerrot/following{/other_user}","gists_url":"https://api.github.com/users/AlexPerrot/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexPerrot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexPerrot/subscriptions","organizations_url":"https://api.github.com/users/AlexPerrot/orgs","repos_url":"https://api.github.com/users/AlexPerrot/repos","events_url":"https://api.github.com/users/AlexPerrot/events{/privacy}","received_events_url":"https://api.github.com/users/AlexPerrot/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nerdammer/spark-hbase-connector/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-25T08:24:08Z","updated_at":"2015-09-25T19:58:31Z","closed_at":"2015-09-25T19:58:31Z","body":"Hello,\r\n\r\nWhen adding salting on the rowKeys using `withSalting`, my sparkJob fails with an `ArrayIndexOutOfBoundsException` on `it.nerdammer.spark.hbase.HashSaltingProvider.salt(SaltingProvider.scala:67)`.\r\n\r\nThe line is:\r\n```scala\r\n override def salt(rowKey: Array[Byte]): T = salting(hash(rowKey) % salting.size)\r\n```\r\n\r\nI think the issue here is that if `hash(rowKey)` is negative, then `hash(rowKey) % salting.size` is also negative, causing the exception."}}