IMPALA-897: shell does not close queries after completion when running from a script

The problem was that we were setting a flag marking the last_query_handle as closed, but
were not resetting the flag before the next query. This caused the first query to
be closed properly, but subsequent queries would not be closed. The fix is to change
where the flag is reset to the same place as where we assign last_query_handle.

Added a test case.

Change-Id: I870a96789489bfe4f388910b808409cd0584af8a
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1966
Reviewed-by: Ishaan Joshi <ishaan@cloudera.com>
Tested-by: jenkins
Fix typo in error message

Change-Id: I1773d329cf2eafafe5cbcd161ab4854d8999f934
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1975
Reviewed-by: Henry Robinson <henry@cloudera.com>
Tested-by: Henry Robinson <henry@cloudera.com>
IMPALA-892: Fix subexpr for IR generated from compound predicate.

Change-Id: I638533827e97f3486eb75a571b18f9e8d1cd4aed
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1973
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1956
Make DataSink::Close() idempotent

PlanFragmentExecutor may call DataSink::Close() twice. This also adds
a DCHECK to NativeUdfExpr::Close(), which should not be called twice
since UDF close functions are not required to be idempotent.

Change-Id: I37e193a8c96135fe4e03e346409fea4aa03665df
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1978
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: jenkins
Fix asan failure due to bug in string search.

Change-Id: I9759109ec2c6c262f5c17393b84dde8dddf851ff
(cherry picked from commit d31cb916637d79c7214d398f3e8d4a8599e74932)
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1972
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: Nong Li <nong@cloudera.com>
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1980
Tested-by: jenkins
CDH-14830: Use correct service name as a Kerberos client

Clients need to provide the correct service name to Kerberos
servers. This patch plumbs a service name all the way from ThriftClient
and the ClientCache to the AuthProvider.

Change-Id: Iad80833a0a24c5021b209bf6704272222c067b57
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1969
Reviewed-by: Henry Robinson <henry@cloudera.com>
Tested-by: jenkins
Admission controller: Fix NPE when Llama configuration is not provided

Change-Id: Ia27e1e727ad1891d05b39e16ca6eafd9a7362a00
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1985
Reviewed-by: Matthew Jacobs <mj@cloudera.com>
Tested-by: jenkins