Pre-script before Direct-Query

Is there a way to execute commands before a direct sql query executes ?
In my case, I’m querying redshift and would like to run the following command so that our quicksight queries are redirected to the appropriate WLM queue: “set query_group to ‘xyz’;”

Sorry, that is not supported. If you could provide more details about your use case, we will discuss internally and get back to you.