Codegen AVG

This uses the same logic as NDV, i.e. cross-compiling the Update and
Merge functions.

Change-Id: I93b5658402e1bfeed141a53f8e52f82952838e45
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4303
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: jenkins
Remove stray ImpalaServer::CreateDataSink() declaration.

The definition doesn't exist. The real one is DataSink::CreateDataSink.

Change-Id: I1f2174ff66e2196b363658eb36ed0eb78f8462a5
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4310
Reviewed-by: Marcel Kornacker <marcel@cloudera.com>
Reviewed-by: Henry Robinson <henry@cloudera.com>
Tested-by: jenkins
Set canonical window/ordering/function when analyzing an AnalyticExpr.

Change-Id: I8f3cef32cbf67bd96abca02cd79468c2c30e6f48
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4218
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: jenkins
CHAR: adding support for CHAR(N)

Support for CHAR is implemented as a StringVal in the backend.

TODO:
  1. Parquet Reader/writer
  2. Codegen slot ref
  3. Codegen text reader
  4. Don't inline large chars
  5. update impala-hs2-server.cc with CHAR support

Change-Id: Ibba2c89cea971cb740001ea7975bf3e929150471
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4075
Reviewed-by: Nong Li <nong@cloudera.com>
Reviewed-by: Victor Bittorf <victor.bittorf@cloudera.com>
Tested-by: jenkins
Fix a few bugs in the AnalyticEvalNode

IMPALA-1233: Crash running query with analytic in WITH clause
IMPALA-1232: Analytic eval node crashes if cancelling query before Open()

Change-Id: I9a263775b8ef670d0f819ed53d0af1eb96edf5c7
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4313
Reviewed-by: Matthew Jacobs <mj@cloudera.com>
Tested-by: jenkins
Enable more tpcds queries that use correlated subqueries and analytic functions.

This patch only operates on queries that use store_sales as the fact table.

Change-Id: I763245ef5f68bb1519bcb4d4b26ede96913a1d57
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4312
Reviewed-by: Ishaan Joshi <ishaan@cloudera.com>
Tested-by: jenkins
Add SHOW ANALYTIC FUNCTIONS and additional analysis checks.

Change-Id: Ic1aac60fb9b094349b9cfbec68608ac50fc5660c
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4298
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: jenkins
Analytic functions tests

Added several tests for analytical functions

Tests for the following have not been added because it's not implemented yet:
- Lag, Lead functions
- Window clauses

Change-Id: I34546c967a6d29c97327f4cba405006a50867dcb
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4307
Reviewed-by: Taras Bobrovytsky <tbobrovytsky@cloudera.com>
Tested-by: jenkins
Fix and add spilling test.

More tests coming.

Change-Id: I09e98adb6b011575572051eff1cd52e7be689fe8
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4311
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: jenkins