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:ย 

py4j.security.Py4JSecurityException: Constructor public org.apache.spark.ml.feature.VectorAssembler(java.lang.String) is not whitelisted.

DataRabbit
New Contributor II

Hello, i have a problem.

When I try to run the MLlib Assembler (from pyspark.ml.feature import VectorAssembler) I get this error and I don't know what to do anymore. Please help.

1 ACCEPTED SOLUTION

Accepted Solutions

Hubert-Dudek
Esteemed Contributor III

Is it High Concurrency cluster with credential passthrough enabled? In that case, you can use a different cluster mode.

https://docs.azuredatabricks.net/spark/latest/data-sources/azure/adls-passthrough.html

This exception is thrown when you have accessed a method that Azure Databricks has not explicitly marked as safe for Azure Data Lake Storage credential passthrough clusters. In most cases, the technique could allow a user on an Azure Data Lake Storage credential passthrough cluster to access another userโ€™s credential.

View solution in original post

3 REPLIES 3

Hubert-Dudek
Esteemed Contributor III

Is it High Concurrency cluster with credential passthrough enabled? In that case, you can use a different cluster mode.

https://docs.azuredatabricks.net/spark/latest/data-sources/azure/adls-passthrough.html

This exception is thrown when you have accessed a method that Azure Databricks has not explicitly marked as safe for Azure Data Lake Storage credential passthrough clusters. In most cases, the technique could allow a user on an Azure Data Lake Storage credential passthrough cluster to access another userโ€™s credential.

Thanks you so much!

DBXC
Contributor

How could we whitelist this error below with DBR 13.3 and above? 

Py4JError: An error occurred while calling None.org.apache.spark.ml.recommendation.ALS. Trace: py4j.security.Py4JSecurityException: Constructor public org.apache.spark.ml.recommendation.ALS(java.lang.String) is not whitelisted. at py4j.security.WhitelistingPy4JSecurityManager.checkConstructor(WhitelistingPy4JSecurityManager.java:451) at py4j.Gateway.invoke(Gateway.java:256) at py4j.commands.ConstructorCommand.invokeConstructor(ConstructorCommand.java:80) at py4j.commands.ConstructorCommand.execute(ConstructorCommand.java:69) at py4j.ClientServerConnection.waitForCommands(ClientServerConnection.java:199) at py4j.ClientServerConnection.run(ClientServerConnection.java:119) at java.lang.Thread.run(Thread.java:750)

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