class SetSessionAuthorizationPlan implements Plan {

    private final AnalyzedSetSessionAuthorizationStatement setSessionAuthorization;
    private final Roles roles;

    public SetSessionAuthorizationPlan(AnalyzedSetSessionAuthorizationStatement setSessionAuthorization,
                                       Roles roles) {
        this.setSessionAuthorization = setSessionAuthorization;
        this.roles = roles;
    }

    @Override
    public StatementType type() {
        return StatementType.MANAGEMENT;
    }

    @Override
    public void executeOrFail(DependencyCarrier executor,
                              PlannerContext plannerContext,
                              RowConsumer consumer,
                              Row params,
                              SubQueryResults subQueryResults) throws Exception {<FILL_FUNCTION_BODY>}
}

        var sessionSettings = plannerContext.transactionContext().sessionSettings();
        String userName = setSessionAuthorization.user();
        Role user;
        if (userName != null) {
            user = roles.getUser(userName);
        } else {
            user = sessionSettings.authenticatedUser();
        }
        sessionSettings.setSessionUser(user);
        consumer.accept(InMemoryBatchIterator.empty(SENTINEL), null);
    
<no_super_class>