After a discussion with Tez folks, we have been thinking over introducing a table to store sub-application information.
For example, if a Tez session runs for a certain period as User X and runs a few AMs. These AMs accept DAGs from other users. Tez will execute these dags with a doAs user. ATSv2 should store this information in a new table perhaps called as "sub_application" table.
YARN-6733 tracks the code changes needed for table schema creation.
This jira tracks writing to that table, updating the user name fields to include sub-application user etc. This would mean adding a field to Flow Context which can store an additional user