Spark Job server context user change at run time

241 Views Asked by At

How can I change the user of the context created in Spark Job Server? I want to change the user which I am getting on sparkSession.sparkContext.sparkUser();

1

There are 1 best solutions below

0
jose praveen On

follow the below steps.

[root@localhost bin]# export HADOOP_USER_NAME=praveen //set this environment variable
[root@localhost bin]# ./spark-shell // start the spark shell

scala> sc.sparkUser //Spark context available as sc.
res0: String = praveen

By this way you can change the sparkUser value.