[SPARK-17495][SQL] Add more tests for hive hash
authorTejas Patil <tejasp@fb.com>
Fri, 24 Feb 2017 17:46:42 +0000 (09:46 -0800)
committerReynold Xin <rxin@databricks.com>
Fri, 24 Feb 2017 17:46:42 +0000 (09:46 -0800)
commit3e40f6c3d6fc0bcd828d09031fa3994925394889
treee2ea90f5dfd743db6870917f5c5068ebae5f7880
parenta920a4369434c84274866a09f61e402232c3b47c
[SPARK-17495][SQL] Add more tests for hive hash

## What changes were proposed in this pull request?

This PR adds tests hive-hash by comparing the outputs generated against Hive 1.2.1. Following datatypes are covered by this PR:
- null
- boolean
- byte
- short
- int
- long
- float
- double
- string
- array
- map
- struct

Datatypes that I have _NOT_ covered but I will work on separately are:
- Decimal (handled separately in https://github.com/apache/spark/pull/17056)
- TimestampType
- DateType
- CalendarIntervalType

## How was this patch tested?

NA

Author: Tejas Patil <tejasp@fb.com>

Closes #17049 from tejasapatil/SPARK-17495_remaining_types.
common/unsafe/src/main/java/org/apache/spark/sql/catalyst/expressions/HiveHasher.java
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/hash.scala
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/HashExpressionsSuite.scala