Implementing impersonation (proxyUser) in hive-like spark-sql connection

I want to connect metabase to my hive/sparksql, which is governed by ranger policies for access control.

Now i can create a new connection with admin user, however, i need that any user that logs into metabase, should be able to only access tables they're allowed by ranger.

This can be achieved by impersonation, using proxyUser, however, when i checked the code, we need to give proxyUser during connection setup, and it reuses the same connection over and over again.

I may have missed something, as i'm new to clojure, can someone help me setting this up correctly,

I saw starburst code, however, they create a clientSession with every query (as it's making rest calls)

ANy help will be greatly appreciated