IMPALA-1290: AnalyticEvalNode should have results ready after Open()

Change-Id: Id66defa1e7ff8a892a94aa8b754f2ea02d0af7c8
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4450
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: jenkins
IMPALA-1292: Incorrect result in analytic SUM when ORDER BY column is null

The 'less than' predicate created by AnalyticPlanner used to check if the
previous row was less than the current row is not exactly what we want
to determine when rows in RANGE windows (the default window in this case)
share the same result values. Rows get the same results when the order by
exprs evaluate equally or both null, so it's easiest (and more efficient)
to use a predicate that simply checks equality or both null. We already
create such predicates for checking for partition boundaries, so this is
a trivial change.

When we support arbitrary RANGE window offsets we will likely want to
add similar predicates that compare two tuples plus/minus the offset,
but those will be simpler because there can be only one order by expr
when specifying RANGE offsets with PRECEDING/FOLLOWING.

Change-Id: I52ff6203686832852430e498eca6ad2cc2daee98
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4474
Tested-by: jenkins
Reviewed-by: Matthew Jacobs <mj@cloudera.com>
Tested-by: Matthew Jacobs <mj@cloudera.com>
Lazily create codegen object

Before this patch, we would always create the LlvmCodegen object in
the initialization of the runtime state, regardless of if we actually
could use codegen. With this patch, the codegen object is created upon
first use, so we save the overhead of loading and compiling the module
if no codegen is used.

Change-Id: I2bd6e046bf55fd0ba40441c524a0a0bcf133c17d
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4470
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins
Support for disk spill encryption and integrity checking

Two new flags are added:

--disk_spill_encryption (boolean) Turns on encryption when spilling
   data to disk.  Default: false
--disk_spill_integrity (boolean) Turns on integrity checking for
   data spilled to disk.  Default: false

These two flags are independent of each other.

This is implemented in the BufferedBlockMgr, where Blocks that are
about to be written are encrypted and/or MAC'ed, and Blocks that
are read have the MAC verified and/or decrypted.

For encryption we use AES-256-CFB, which means that the key size is
256 bits and the cipher mode is CFB.  CFB is a stream cipher, which
means that it can operate on arbitrary sizes of data.  The AES
implementation can use AES-NI automatically, making it screaming fast.

For an integrity check (aka MAC, or Message Authentication Code) we
use a simple SHA256 hash over the data.

The key, iv, and MAC are stored in memory in the Block instance.
There is a unique key/iv generated each time the Block is written to
disk.  This is not only quite secure, it avoids issues around the
reuse of a stream cipher.

Change-Id: I5858eed93570603c1f20bbbae32ef54a8a1ac89d
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4410
Tested-by: jenkins
Reviewed-by: Michael Yoder <myoder@cloudera.com>
(cherry picked from commit 03c9ef46ba193968d07113392dfd31e30566078b)
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4484
Fail queries where the size of a single row is larger than the io buffer size.

The tuple stream cannot write these right now.

Change-Id: I0711ecd6c0486e7559c60d0126e04eb3072d263e
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4468
Tested-by: jenkins
Reviewed-by: Nong Li <nong@cloudera.com>
Add partition filters to tpcds-q89 and re-enabe tpcds-q47

This patch adds partitions filters to tpcds-q89 to account for the lack of dynamic
partition pruning. Additionally, it also re-enables running tpcds-q47, which was blocked
by IMPALA-1238

Change-Id: Ied05d80565ebb29cd06b3c38d76bd31f0285028e
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4453
Reviewed-by: Ishaan Joshi <ishaan@cloudera.com>
Tested-by: jenkins