I just tested it on a local cluster. Even though this patch is implemented correctly, I experienced a query failure from INSERT OVERWRITE statement due to schema mismatch in 74 line in PartitionedStoreExec.
In more detail, the names of partition columns are not qualified (i.e., no table name), while columns of input schema includes table names. Depending on query cases, 74 line may cause NPE.
However, this is another issue not related to this issue. So, I'll create another jira issue for that bug.
Thank you for your contribution.