I am trying to convert GP to Hive migration logic but below statement giving the wrong output while execute query:
select (date_trunc('Month','2022-01-04'::date ) - interval '0 Month + 1 day')::date
output for GP : 2021-12-31
similar if we converted Hive query
select cast(date_add(add_months(trunc(cast('2022-01-04' as date),'MM'),-0),1) as date)
out put if Hive query : 2022-01-02
i could see the difference of the date. please help me.
Thanks