cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
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
Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.