process date status
A 04/01/2020 finished
A 04/02/2020 finished
A 04/03/2020 run_again
Using impala queries i have to get the maximum date from second table T2 and get its status. According to the above table 04/03 is the maximum date.
If the status is finished on 04/03, then my query should return the next available weekday date from T1 which is 04/06/2020.
But if the status is run_again, then the query should return the same date. In the above table, 04/03 has run_again and when my query runs the output should be 04/03/2020 and not 04/06/2020.
What I tried so far: I ran a subquery from second table and got the maximum date and its status. i tried to run a case in my main query and gave t1 as subselect in Case statement but its not working. Looks like case statement does not allow a select statement within it.
Is it possible to achieve this through Impala query?