Fix NULL handling in ArithmeticExpr

Before: if both operands to an arithmetic expression were null
literals, we would set the operand types and return type to INT. This
isn't correct for operators that don't support ints, e.g. divide
(there's a separate integer division function), since the function
signature wouldn't match the arithmetic expr's types. I think we
didn't run into problems because the BE uses void*s everywhere, but I
hit this when I switched the arithmetic functions to the UDF
interface.

In addition, some of the builtins were registered with the wrong
return type.

After: set the operand types to a type appropriate for the operator
before we set the return type, meaning the return type gets assigned
correctly using the existing logic.

Change-Id: I39fa147c178d895bdffaf1be676ddaa3af1d42c8
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3255
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: jenkins
Prepare resource broker for cancellation changes

This patch anticipates the changes to Llama that allow a
client-specified resource ID to be returned with every reservation or
expansion request. Doing this allows us to remove the tricky
coordination logic between WaitForNotification() and AMNotification()
when we don't know which side will access the rendezvous data structures
first. Now we can guarantee that the consumer-side will be set-up before
the notification is received.

Change-Id: I908b1dae8d074a84b0465e3a444d6651f126efd7
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3093
Reviewed-by: Henry Robinson <henry@cloudera.com>
Tested-by: jenkins
(cherry picked from commit 24d0c0210f1b03443ffc7cf2f53a945c7b8dd7e2)
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3257
Fix memtracker instantiation when using FETCH_FIRST

Change-Id: I47b614b3559880f428951b015291bee4f5af6c49
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3038
Reviewed-by: Henry Robinson <henry@cloudera.com>
Tested-by: jenkins
(cherry picked from commit 1d34f23d69dc1a55e1e68a8acae94a57945f86e0)
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3256
Fix decimal multiply result precision off by 1.

Change-Id: I860e0d13ee9bae7d3e180103a22fe7606a320b13
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3249
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins
Switch debug builds to use clang.

I've often seen that we are unable to properly debug on customer machines
running rhel6 (e.g. "Can't compute CFA..."). This results in not having symbols
resolve correctly. A little poking around indicates these are bugs in GDB and
I think it will be pretty difficult to update GDB on our build machines. On
the other hand, they are all running a much newer version of clang which I hope
is less buggy/more likely to be patched if there are bugs/etc.

If people have a particular affinity for GCC for development, I can modify this
patch to respect that.

Change-Id: I4f655313384222732834cb3267c9954b6c825a57
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3279
Reviewed-by: Henry Robinson <henry@cloudera.com>
Tested-by: jenkins
Change logging level of thrift plan in plan fragment executor.

VLOG(3) includes each row which is much less often useful than the serialized
plan.

Change-Id: I933188f046dafb51da9d06583697792113a9165a
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3289
Reviewed-by: Marcel Kornacker <marcel@cloudera.com>
Tested-by: jenkins