How hashing works in bucketing for hive?

后端 未结 2 1862
自闭症患者
自闭症患者 2021-01-23 18:09

I know the hashing principal for HashMap in Java, so wanted to know that how the hashing works for the Hive while we bucketing the data in various bucket.

2条回答
  •  终归单人心
    2021-01-23 18:39

    I recently had to dig into some Hive source code to figure this out for myself. Here's what I found:

    For an integer field, the hash is just the integer value. For a string, it uses a similar version of Java's String hashCode. When hashing multiple values, the hash is a similar version of Java’s List hashCode.

提交回复
热议问题