IMPALA-875: Respect isAnalyzed_ in IntLiteral expressions

Partition column expressions are analysed twice for INSERT statements -
once to infer the type and so to add a possible cast, and once to
compute stats on the resulting expr. However, this process resulted in
an partition column expr that was a IntLiteral getting the smallest type
that would contains its value, rather than retaining the
column-compatible type that had been assigned to it.

This patch does the minimum thing, which is make IntLiteral.analyze()
idempotent. Doing the same thing to Expr and LiteralExpr unearths some
other bugs, which we will have to fix in a follow-on patch (see
IMPALA-884).

Change-Id: Ie22fc5d3f4832c735a1ebc0ef78f50d736f597fd
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1931
Reviewed-by: Henry Robinson <henry@cloudera.com>
Tested-by: jenkins
UDF/UDA memory management improvements

* AggFnEvaluator now uses the UDF mem pool (I'm planning to change
  this to per-exec node pools in the expr refactoring)
* FunctionContext::TrackAllocation()/Free() actually use the UDF's mem tracker
* Added FunctionContextImpl::Close() which sets warnings for leaked allocations

Change-Id: I792ffd49102a92b57e34df18d8ff5f5d0fd27370
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1792
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: Skye Wanderman-Milne <skye@cloudera.com>
Check that fair-scheduler allocation file must is specified if RM is enabled

Change-Id: Id46be49168d79b208700f4e5dd241daed6c52837
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1943
Reviewed-by: Lenni Kuff <lskuff@cloudera.com>
Tested-by: jenkins
Admission controller: Add flag to completely disable admission control

Adds a gflag "-disable_admission_control" to completely disable admission control.
Also fixes/improves two admission control gflag messages.

Change-Id: I0f6a295657c2109f0e19501742b759c8ae8d5d1a
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1948
Reviewed-by: Lenni Kuff <lskuff@cloudera.com>
Tested-by: jenkins
Admission control: Few trivial improvements for logging and clarity

Change-Id: I725c1c0845974ab73e77d0262701ddd4346e4f78
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1945
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: jenkins
Cleanup how we handle compact_data in the scanners.

Previously compact_data meant two things and was very confusing.
  1) do the tuples from the scan-node need to be compact. i.e. does it need
     to copy all the referenced string data into a contiguous mem pool.
  2) do the tuples from the scan-node reference io buffers/buffer in the
     scanner context.

I've reworked the scanners to understand this better differentiate the two and
minimize copies. The new scanners should prefer
  1) reallocating new buffers > copying
  2) reusing (decompression/staging) buffers whenever possible

This patch allows scanners to be much more memory efficient reducing the minimum
memory needed from ~120mb to < 40mb.

Change-Id: I1e5af073be9497f8b00947769753b46629b29c3c
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1927
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins