IMPALA-949: Fix scan range initial queue capacity.

Change-Id: I289c61587da75b318ba5a543d31010920a9cffe9
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2242
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins
IMPALA-945: Fix column reordering with SELECT expressions

Previously, to produce the correct output expressions for the root plan
fragment before a table sink, InsertStmt would reorder the result
expressions for the query statement at the plan root. This had stopped
working for SelectStmts (and test coverage didn't catch that).

Now InsertStmt produces its own output expressions that can substitute
for the originals from the query statement, and the planner uses those
instead.

All query tests for column reordering have been duplicated to use SELECT
expressions.

Change-Id: Ib909fe35d27416b33ba2e5ac797aa931e1fe43f9
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2204
Tested-by: jenkins
Reviewed-by: Henry Robinson <henry@cloudera.com>
Fix active time reporting in runtime profiles.

- A few places didn't have total timer at the beginning.
- Async build thread for blocking join nodes really messed things up (sum of
  children was more than the time in the join node).

Change-Id: I9176ce37cf22f2bcebea21b117e45cce066dbc1d
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2229
Tested-by: jenkins
Reviewed-by: Nong Li <nong@cloudera.com>
IMPALA-912: Enforce slot equivalences at the lowest possible plan node.

The reported issue is that we can have redundant hash expressions in exchanges.
The underlying cause is that we fail to remove redundant join predicates.
This patch enforces slot equivalences based on our computed equivalence classes
at the lowest possible plan node by generating new equality predicates.
Each plan subtree now has a minimal set of equality predicates that express
all known equivalences between slots belonging to tuples materialized at that
plan node.
As a result, eliminating redundant join predicates becomes trivial: It is
sufficient to pick a single representative predicate of each relevant equivalence
class. All predicates beyond that are redundant.

Change-Id: I7998fe8d7bdf84cc8eb129d32c86269bedeab68e
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2177
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: jenkins
IMPALA-839: Update tests to be more thorough when run exhaustively

Some tests have constraints that were there only to help reduce runtime which
reduces coverage when running in exhaustive mode. The majority of the constraints
are because it adds no value to run the test across additional dimensions (or
it is invalid to run with those dimensions). Updates the tests that have
legitimate constraints to use two new helper methods for constraining the table format
dimension:
create_uncompressed_text_dimension()
create_parquet_dimension()

These will create a dimension that will produce a single test vector, either
uncompressed text or parquet respectively.

Change-Id: Id85387c1efd5d192f8059ef89934933389bfe247
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2149
Reviewed-by: Lenni Kuff <lskuff@cloudera.com>
Tested-by: jenkins
IMPALA-914: Map null type to boolean in JDBC to be compatible with Hive.

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