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: 

Is it possible to pass configuration to a job on high concurrency cluster?

DouglasLinder
New Contributor III

On a regular cluster, you can use:

```

spark.sparkContext._jsc.hadoopConfiguration().set(key, value)

```

These values are then available on the executors using the hadoop configuration.

However, on a high concurrency cluster, attempting to do so results in:

> py4j.security.Py4JSecurityException: Method public org.apache.hadoop.conf.Configuration org.apache.spark.api.java.JavaSparkContext.hadoopConfiguration() is not whitelisted on class class org.apache.spark.api.java.JavaSparkContext

Is there a way around this? Or is a limitation of the high concurrency cluster type?

The goal here is to pass tokens that are generate at runtime to the executor, which means that setting the details in the cluster settings (ie. cluster > advanced > spark > spark config) is not suitable.

4 REPLIES 4

Ryan_Chynoweth
Esteemed Contributor

I am not sure why you are getting that error on a high concurrency cluster. As I am able to set the configuration as you show above.

Can you try the following code instead?

sc._jsc.hadoopConfiguration().set(key, value)

Sorry, I failed to mention that I had selected 'credential passthrough' for my cluster, which adds the these features to the cluster configuration:

spark.databricks.passthrough.enabled true

spark.databricks.pyspark.enableProcessIsolation true

If you remove this then it works as normal.

Got it. I am fairly certain that is related to the passthrough limitations as you probably assumed. In the link it says there are limitations around SparkContext methods and SparkSession objects. It does not explicitly list your issue but I assume it is similar enough to apply.

Does removing those configs work for your environment? Do you require passthrough?

I guess it's just not supported; I wanted per-user hadoop configuration.

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