[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.
Here I added this behavior  because ```union all``` have the same behavior in Spark HiveQL. So there are differences in ```union all``` behavior also when compared to HIve. Shall I change the behavior for ```union all``` in Spark HiveQL and make it similar as Hive?