Speed up PHJ.

This patch does a few things to speed up probe performance by ~50% in a fact to dim
table join on a single int64 key.

- Change IR function to return int instead of status. This doesn't change performance
but makes the IR much easier to read.
- Switch from FNV to murmur2 hash. I had done some experiments before and this function
is much faster than FNV and produces better hashes.
- Remove some unnecessary state in HashTableCtx that was not necessary and generating
load/stores.
- Cache the per partition hash table instead of walking the hash_partitions_ structure.

This takes us from roughly 2x slower from v1.4 to ~35% slower. If I switch the hash
function to CRC (like in v1.4) the perf difference is <5%. In a follow up patch, we'll
probably have to use CRC as the first level to get perf parity in the non-spilling
case.

Change-Id: I7481a35ed767d4817e78d06fe85016408620a85a
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4325
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins
Fix AVG codegen

We weren't returning the right merge function for decimal in
GetAvgFunction(). Someday the functions will be registered in the FE
like for scalar functions.

Change-Id: I1153ef8570b0e78f0925b7d3d58ec3b0fbb2c589
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4336
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins
Codegen SUM(decimal)

On a simple local benchmark that sums a decimal column, this improves
query time by ~4x.

Change-Id: I4968a31c66f94ac55b1d3a6e51707f72b81b662a
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4341
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: jenkins
CDH-21520: Better error message for invalid HdfsScanNode cardinality_

Change-Id: I6aaf22826d9108cd8a6e32416d636806f0631523
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4339
Reviewed-by: Marcel Kornacker <marcel@cloudera.com>
Tested-by: jenkins
Add null check for database in HS2 MetadataOp

It is possible the database was dropped between the call to getDbNames() and
getDb(dbName) causing a NPE.

Change-Id: Icc4d0f5c54995783dd59d73f2db3050369a6f944
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4343
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: jenkins