IMPALA-1111: Fix alignment in ReservoirSample aggregate functions

Change-Id: Iac7aa96eb19079715a7e8152a5edfeafa0d50bc7
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4478
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: jenkins
Minor PA/PHJ improvements.

- PHJ: estimate the hash table size when constructing the hash table.
- PA/PHJ: process spilled partitions in depth first order.

Change-Id: I25df6019246f9f751e376afa405bdacc79da6381
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4490
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: jenkins
Allow UDA intermediates to use CHAR. Update stddev/var to use it.

Change-Id: I791c6389978f4994cba33f01273e94343a163916
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4368
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: jenkins
IMPALA-1264: Re-enable test_session_experation.py

This has only failed once as far as I can tell, and we don't have any log
files for the failure.  Nor have I been able to repro.  So, let's increase the
test timeout to get a bit more slop in the case of the occasional long sleep
on the impalad side.  If there is a bug where a session is stuck in the
checked-out state, the test will still find it.

Change-Id: Ib63a8a83d9c3e772787dc548473868c58f950eb8
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4494
Reviewed-by: Daniel Hecht <dhecht@cloudera.com>
Tested-by: jenkins
IMPALA-1289: Fix predicate assignment for inverted joins.

Change-Id: I017c39f77df0264a7ee35dca28ee263aa55ca517
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4491
Reviewed-by: Marcel Kornacker <marcel@cloudera.com>
Tested-by: jenkins
IMPALA-1245: Fix log spew (mainly from FE)

Change-Id: Ib9fc89d4cc0ae87cbd4d41e760c742a130712991
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4473
Reviewed-by: Marcel Kornacker <marcel@cloudera.com>
Tested-by: jenkins
Fix for bug in AnalyticExpr.resetAnalysisState()

Fixes:
IMPALA-1256: Nested analytic: AnalysisException: select list expression not produced by aggregation output
IMPALA-1280: Crash running analytic with LEFT SEMI JOIN

Change-Id: I98b8f90de0079afad5b2d547abc27bcee57651f3
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4500
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: jenkins
Fix session expiration test.

The session expiration test would occasionally fail because two sessions ended up expiring
at approximately the same time. This patch ensures that no session is active when the
initial metric value is polled.

Change-Id: Ib62e7c23fb0c43e0e8ee0c17770d47df19964117
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4502
Reviewed-by: Ishaan Joshi <ishaan@cloudera.com>
Tested-by: jenkins
IMPALA-1111: Fix previous DecimalVal alignment patch

The compiler was changing the memcpy into an operation requiring
16-byte alignment.

Change-Id: Ic76ecffe231f82c4dff0edcabe5b9d26e5636bbe
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4508
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins
Remove obsolete data compaction flag from FE.

Change-Id: I0413d87d07fc07c14dc6c415c503065fc4944613
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4499
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: jenkins
IMPALA-1165: Predicate dropped: Inline view plus distinct aggregate in
outer query

This commit fixes a bug with marking propagated predicates as assigned
during slot materialization. When gathering predicates for the purpose
of slot materialization, no predicates should be marked as assigned.

Change-Id: I5277dc622990b1731db1ecb3ea646e7b72d4e3db
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4496
Reviewed-by: Dimitris Tsirogiannis <dtsirogiannis@cloudera.com>
Tested-by: jenkins
IMPALA-1118: Retain join predicates that reference a slot of an outer-joined tuple.

The bug: When gathering join predicates, we eliminate redundant ones based on
equivalence classes. However, predicates that reference an outer-joined tuple cannot
be safely removed even if the corresponding equivalence class is already covered by
another predicate because such predicates could imply 'slot IS NOT NULL' and removing
them would allow NULL tuples from outer joins to be incorrectly returned.

The fix: Retain otherwise redundant predicates if they reference a slot of an
outer-joined tuple to maintain that the output of a join satisfies 'slot IS NOT NULL'
(otherwise NULL tuples from preceding outer joins could incorrectly survive).
For each outer-joined slot we only need to retain a single predicate.
TODO: Consider better fixes for outer-joined slots: (1) Create IS NOT NULL
predicates and place them at the lowest possible plan node. (2) Convert outer
joins into inner joins (or full outer joins into left/right outer joins).

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