Calculate number of days excluding sunday in Hive
问题 I have two timestamps as input. I want to calculate the time difference in hours between those timestamps excluding Sundays. I can get the number of days using datediff function in hive. I can get the day of a particular date using from_unixtime(unix_timestamp(startdate), 'EEEE'). But I dont know how to relate those functions to achieve my requirement or is there any other easy way to achieve this. Thanks in Advance. 回答1: You can write one custom UDF which takes two columns containing the