Optionally dynamically link Impala executables

This patch adds two new flags to make_impala.sh:

-build_shared_libs: Impala libraries (excluding thirdparty ones) will be
 built as shared objects (.so), and linked dynamically.

-build_static_libs: Impala libraries will be built as archive
 files (.a), and linked statically. This was the behaviour before this
 patch, and is still the default for make_impala.sh.

The speedup from dynamic linking for a clean build is significant:

make_impala.sh -clean -build_static_libs: 11m48.676s
make_impala.sh -clean -build_shared_libs:  5m46.943s

make_debug.sh now passes -build_shared_libs by
default. make_[asan|release].sh still builds with statically linked libraries. All
automated builds will be statically linked for now; we can move them to
dynamic linking on a case-by-case basis.

Change-Id: Icfd8101bf8e85cadd61d8995ae8864f8730297ea
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3828
Reviewed-by: Henry Robinson <henry@cloudera.com>
Tested-by: jenkins
IMPALA-958: Don't store full paths in scan ranges.

When there are a lot of scan ranges per partition, we can reduce the
TQueryExecRequest footprint by storing only file names in the scan
ranges.  The directory path can be inferred by the partition id.

How much this reduces the footprint is dependent on the number of scan
ranges per parition and the length of the absolute path, but in our
test cluster for a partition with many files (~1000), this change
reduces the scan range size by about 30%.

Change-Id: I48fc72433dfd8ad7105c18694eae909c232fe8d7
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3844
Reviewed-by: Marcel Kornacker <marcel@cloudera.com>
Tested-by: jenkins
Rewrite decimal functions/operators as UDFs.

This patch also adds a GetReturnType() method to FunctionContext. This
is staging for the expr refactoring.

Change-Id: I854e79ded409e151663c4ec99c4e08631ad9e03e
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3234
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: Skye Wanderman-Milne <skye@cloudera.com>
Rewrite operators as UDFs.

This patch removes gen_operators.py, replacing it with operators.h/cc
and cast-functions.h/cc. Case cannot be implemented as a UDF so is
still expressed in original interface. This will be updated when the
main expr refactoring patch goes in.

Change-Id: I69df3b4546608ef641b8b845e9ec36d14e8c189b
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3406
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: Skye Wanderman-Milne <skye@cloudera.com>
Convert math functions to the UDF interface.

Also adds FunctionContext::GetNumArgs() method to the public UDF API.

Change-Id: I76e21814e423f075a0a22b4e924c1d3ec26daba7
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3410
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: Skye Wanderman-Milne <skye@cloudera.com>
Convert string functions to UDF interface

This also switches to using the re2 library for regular expression
functions instead of boost.

Change-Id: I4c3ae72ff2f7cbd5b1a2be719275f1b2e25f8ab2
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3412
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: Skye Wanderman-Milne <skye@cloudera.com>
Expr refactoring

This patch changes the interface for evaluating expressions, in order
to allow for thread-safe expression evaluations and easier
codegen. Thread safety is achieved via the ExprContext class, a
light-weight container for expression tree evaluation state. Codegen
is easier because more expressions can be cross-compiled to IR.

See expr.h and expr-context.h for an overview of the API
changes. See sort-exec-exprs.cc for a simple example of the new
interface and hdfs-scanner.cc for a more complicated example.

This patch has not been completely code reviewed and may need further
cleanup/stylistic work, as well as additional perf work.

Change-Id: I3e3baf14ebffd2687533d0cc01a6fb8ac4def849
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3459
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: Skye Wanderman-Milne <skye@cloudera.com>
Fix expr refactoring rebase

Change-Id: Ice4846c65945f3fc06a2c18db136482966c632dc
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3858
Reviewed-by: Henry Robinson <henry@cloudera.com>
Tested-by: Skye Wanderman-Milne <skye@cloudera.com>
Small changes to thirdparty builds

* Move openldap to /impala_install to avoid conflict with INSTALL file
* Don't build Thrift support for languages we don't use

Change-Id: I260b3b4bdecc26b5525e5117a265add6638773c0
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3854
Reviewed-by: Lenni Kuff <lskuff@cloudera.com>
Tested-by: jenkins
Typo in make_impala.sh

Change-Id: Ife635b3ebcbb640147ff9f124f1f2d7ee6656846
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3855
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins