IMPALA-1301: Invalid rewrite of uncorrelated scalar subquery when outer
expr is in both sides of binary predicate

This commit fixes the issue where an invalid rewrite is performed for
scalar uncorrelated subqueries that participated in a binary predicate
in which columns from the outer query block appear in both sides. We fix
this issue by rewritting the subquery using a cross join and placing
binary predicate in the outer's WHERE clause.

Change-Id: Ic5234bd2ee704d5ddead9217a636259e694e3eda
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4512
Reviewed-by: Dimitris Tsirogiannis <dtsirogiannis@cloudera.com>
Tested-by: Dimitris Tsirogiannis <dtsirogiannis@cloudera.com>
Fix hash table buckets to allocate memory from the BlockMgr.

This was always a TODO. We want memory to come from the block mgr and trigger spilling.

Change-Id: I07f1f79fbbb33068fb2df64510a80a9b008ef73d
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4466
Tested-by: jenkins
Reviewed-by: Nong Li <nong@cloudera.com>