Hello @thari
To answer this issue you are facing:
Whatโs actually happening here is that when you try to write to a Delta table managed by Unity Catalog within a QueryExecutionListenerโs callback, Sparkโs security context isnโt set up correctly. That means the process/thread handling the listener code doesnโt have the required Unity Catalog โcredential scopeโ to authorize the table write, which triggers the MissingCredentialScopeException.
This isnโt just a weird bugโitโs by design. Unity Catalog expects all privileged operations (like Delta writes) to run in a proper user session context, and the threads running listeners like QueryExecutionListener simply donโt have that context. In other words, the Spark engine is running your callback code in a background thread that knows nothing about who you are, so thereโs nothing to pass along as credentials to Unity Catalog.
The fix is to move your Delta write logic out of the QueryExecutionListener and into the main job flow.
Hope this answers your doubt.