[SPARK-4648][SQL] Support COALESCE function in Spark SQL and Hive QL

Support Coalesce function in Spark SQL.
Support type widening in Coalesce function.
And replace Coalesce UDF in Spark Hive with local Coalesce function since it is memory efficient and faster.
Tests like this might be a little easier to read/write if you just use literals in the SELECT clause.