I am working in Impala with the following table:
customer_id | day_id | return_day_id ABC 20170830 20170923 BCD 20170830 20170901
Unfortunately, both the day_id & return_day_id fields are INT and not date.
How can I change their datatype to be date, so that I can count distinct customer_ids only with return_day_id within 4 days after day_id. Would I need to cast it to date and then to timestamp so that I can use the adddate function?