IMPALA-1342: Update outer-join analysis state to accommodate join inversion.

Change-Id: I9f0bb4af78b77a56a144a07ee9ed235711a12655
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4727
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: jenkins
Agg w/o grouping not estimating/reporting the right number of rows.

Change-Id: I63ef99f9c123da1116f94d4f6f413764ff16a518
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4726
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: jenkins
Disable the get_log_once test in the shell.

Will be re-enabled when the fix for getting the whole warning log goes in.

Change-Id: If0209dd45038d36a6a3b2d83da88662ae2cf74c5
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4592
Reviewed-by: Lenni Kuff <lskuff@cloudera.com>
Reviewed-by: Ishaan Joshi <ishaan@cloudera.com>
Tested-by: Ishaan Joshi <ishaan@cloudera.com>
IMPALA-1343: Fix chain of left table refs when inverting a join.

Change-Id: Ib509f14d65578e3d8e8cccb015d569cb39e3e8a2
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4736
Reviewed-by: Marcel Kornacker <marcel@cloudera.com>
Tested-by: jenkins
Change the try/except/finally block to a try/finally block for python 2.4 compatibility.

Change-Id: I21fcbb761c168e2cbaeeae1c3850c97119f75cdd
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4735
Reviewed-by: Ishaan Joshi <ishaan@cloudera.com>
Tested-by: jenkins
IMPALA-1350: rework symbol resolution

This passes our current UDF tests, and I manually checked that it
fixes the Impyla issue.

Change-Id: I6591c316e4a479b44057e26bed5892a559edbc85
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4741
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: jenkins
CDH-22170: annotate CHAR and VARCHAR with "UTF8" in Parquet schema

I confirmed that Parquet var/char columns written by Impala can now be
read by Hive.

Change-Id: I14d2fc646835fc5ec0a64e0b93efd6d83511898a
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4749
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins
IMPALA-1234: Fix bugs when producing EmptySetNode

Fixes two issues that can occur when generating the plan for a
stmt with an empty result set (e.g. due to limit 0 or constant
predicates that evaluate to false):
 1) Unions with an inline view that produces an empty result set
    does not create the EmptySetNode for the correct stmt.
 2) An EmptySetNode may contain non-materialized tuples which
    will fail a precondition check when generating the thrift
    plan.

Change-Id: I1511c755be3a59fdb8934624fd08250323266d27
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4744
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: jenkins
IMPALA-1332: Fix memory leak for FULL OUTER/RIGHT OUTER joins.

This can happen if not all rows are returned.

Change-Id: I4d54641b71c44faa85a2138d16f9dda1052317b5
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4737
Tested-by: jenkins
Reviewed-by: Lenni Kuff <lskuff@cloudera.com>
IMPALA-1355: Allow spilling multiple partitions each time we need to spill.

Before, if we needed to spill, we'd spill a single partition and then try to
continue processing the current row. The spilled partition does not have to
be the partition that the row needs to go to. It is possible that after spilling
another partition, there is still not enough memory to process the row. This
can happen if something else (another query, or another part of this query) uses
the memory that was freed from spilling.

The query is only guaranteed to make indefinite progress when all the partitions
have been spilled and the reservation mechanism guarantees progress. This patch
does exactly that by repeatedly spilling partitions until we can accommodate the
row.

Change-Id: I1c515905c16be6f4950c1dc5cdc09338cfcf9e45
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4758
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins
Log leaks on release builds.

I suspect we're leaking on the cluster. Logging this will be helpful.

Change-Id: Ife39d0b8b091a56c098df066303b71ea97aa576a
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4759
Reviewed-by: Marcel Kornacker <marcel@cloudera.com>
Tested-by: jenkins
IMPALA-1354: Disallow constant expressions in order by and partition by exprs

Postgres and Oracle allow constant expressions in the order by and partition exprs
which we don't currently handle properly when there are no other slots referenced.
In this case, the FE still produces a SortNode (though there's nothing to sort)
with an empty sort tuple and the BE crashes. Given that this is a strange corner
case that isn't really useful, we're just disallowing constant exprs in order by
and partition by exprs for now.

Change-Id: Ib2bcf8896a1fb7100c19e3a2bf4bfb92514feab9
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4765
Reviewed-by: Matthew Jacobs <mj@cloudera.com>
Tested-by: jenkins
Fix metrics in IoMgr when returning IO buffers.

Change-Id: I5a50eb71f8d3af53de4654f2eae7e2bee8b179d7
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4766
Reviewed-by: Marcel Kornacker <marcel@cloudera.com>
Tested-by: jenkins