run-workload should exit with a non-zero error code if a query fails and abort_on_error is true

The exception raised by a child thread did not reach the main thread, so the
script exited with 0 instead of 1.

Change-Id: I09be9dc824386bf25a64af0323cbf78f6d006b91
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3081
Reviewed-by: Taras Bobrovytsky <tbobrovytsky@cloudera.com>
Tested-by: jenkins
Make sure QueryExecState::Wait() completes before fetching rows.

We run Wait() asynchronously for API compatibility, but many
QueryExecState functions cannot actually be run concurrently with
Wait() (e.g., Wait() opens output_exprs_, which are then evaluated in
FetchRows()).

Change-Id: I708aa23fdb238ee7aede1113790f48da2859cab9
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2993
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: jenkins
Adding MADlib vector operations.

These are basic UDFs which the user will need to interact with MADlib.

Change-Id: Iadcec2376e29d2f73f1bb04d5e695c58d9381952
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2368
Reviewed-by: Victor Bittorf <victor.bittorf@cloudera.com>
Tested-by: jenkins
IMPALA-1041: Detect partitions that contain invalid MD

Previously, we would load a partition but would not perform any validation on whether
the partition metadata was actually well formed (could be converted into our
internal thrift representation). This updates our table loading logic to do
add an additional validation check after creating a partition to ensure the metadata is
well formed.
The hang reported in IMPALA-1041 was because we were unable to convert the target table
toThrift() so it never got sent to the impalad from the catalog server due to invalid
partition metadata.

Change-Id: I4848427cbc923d6a0e515ba5154e900981dbf9ae
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2981
Reviewed-by: Lenni Kuff <lskuff@cloudera.com>
Tested-by: jenkins
Rework planning of unions s.t. a UnionStmt produces a single MergeNode.

This patch changes the planning of a UnionStmt s.t. it always produces a single fragment
with a MergeNode connecting all child fragments as its root.
The data partition of the returned fragment and how the child fragments are merged
depends on the data partitions of the child fragments:
- All child fragments are unpartitioned or partitioned: The returned fragment is
  has a UNPARTITIONED or RANDOM data partition, respectively. The MergeNode absorbs
  the plan trees of all child fragments.
- Mixed partitioned/unpartitioned child fragments: The returned fragment is
  RANDOM partitioned. The plan trees of all partitioned child fragments are absorbed
  into the MergeNode. All unpartitioned child fragments are connected to the
  MergeNode via a RANDOM exchange, and remain unchanged otherwise.

Also adds support for random partitioned data exchanges.

Change-Id: I82b2d12c104d98c4e7133234653ee1b67658ef7a
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2876
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: jenkins