cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Why does the Spark user differ if using sparklyr from Spark SQL?

J15S
New Contributor III

My team uses a shared cluster. We've been having issues with spark_connect failing to work at times (can't easily reproduce). One thing I've recently noticed is that the Spark user through sparklyr seems to be set to the first person who connects to Spark on the (shared) cluster.

```

library(sparklyr)

sc <- spark_connect(method = "databricks")

DBI::dbGetQuery(sc, 'select current_user() as user')

```

which is not necessarily the same as user identified with Spark SQL in a notebook.

```

%sql

select current_user() as user

```

Is this a bug? Could this be causing Spark connection issues?

0 REPLIES 0

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group