I need to convert a script written in hive-SQL to Redshift's SQL.
I am stuck with the following piece:
select date_format(date_add(date_sub(current_date,cast(from_unixtime(unix_timestamp(current_date, 'yyyy-MM-dd'),'u') as int)),7), 'dd MMM')
Having no experience with timestamp functions of hive-sql, I am unable to re-write this line in redshift.
`current_date` is actually a timestamp column upon which some computation is done.
Please provide with some insight/suggestion. It will be really helpful.