Is there an option to set stating day of the week to be Sunday so when calling trunc(timestamp, string unit) with 'D' I will get the date of Sunday and not of Monday
This can be done in oracle if you set the NLS_TERRITORY or alike but I could not find how to set it in impala
I created a JIRA on your behalf for the request https://issues.apache.org/jira/browse/IMPALA-5626. We don't have that support right now.
I think you can work around this in some cases, e.g. with trunc you can do some date arithmetic:
select trunc(cast('2017-07-03' as timestamp) + interval 1 day, 'DAY') - interval 1 day;