I am running Redshift queries with Metabase as the front end. I want to detect and cancel long running queries for a particular user. How do I automate this process with a script?
This can be set as cluster configuration parameter on cluster or workload level. Workload is a separate query queue that is associated to specific users and defines the amount of cluster resources that is allowed to consume.
Read more about query timeouts here: statement_timeout and WLM Timeout
General info about workload management here: Configuring Workload Management