As of Hive 1.1.0, last_day(string date)
function is available.
last_day(string date)
Returns the last day of the month which the date belongs to. date is a string in the format ‘yyyy-MM-dd HH:mm:ss’ or ‘yyyy-MM-dd’. The time part of date is ignored.