cancel
Showing results for 
Search instead for 
Did you mean: 
Administration & Architecture
cancel
Showing results for 
Search instead for 
Did you mean: 

Connect to databricks from external non-spark cluster

Ishmael
New Contributor III

Hi,

I have an app/service on a non-spark kubernetes cluster. Is there a way to access/query a databricks service from my app/service? I see documentations on connectors, particularly on scala which is the code of my app/service. Can I use these connectors from outside the databricks cluster?

1 ACCEPTED SOLUTION

Accepted Solutions

Kaniz
Community Manager
Community Manager

Hi @Ishmael, Yes, you are correct. ScalaPy is a library that enables seamless interoperability between Scala and Python. It is based on the Py4J project, which allows Python programs running in a Python interpreter to dynamically access Java objects in a Java Virtual Machine. ScalaPy is designed to be easy to use and integrate with existing Scala and Python code. You can find more information and examples on how to use ScalaPy on its [official website]1 or its [GitHub repository]2. I hope this helps! 😊.

View solution in original post

7 REPLIES 7

Kaniz
Community Manager
Community Manager

Hi @Ishmael , You can use Databricks Connect to connect to a Databricks workspace from your local machine or a non...23. Databricks Connect is a client library that allows you to run Spark code from your local machine or a non-Databricks environment such as a Kubernetes cluster. You can use Databricks Connect to connect to a Databricks workspace and run Spark code on a Databric....

Ishmael
New Contributor III

Thanks Kaniz. I am checking this out. Is this right that it only currently supports scala 2.12? I'm using Scala 2.13 so this might be a problem. Is there an alternative?

Kaniz
Community Manager
Community Manager

Hi @Ishmael

According to a Databricks community post, Databricks Runtime does not yet support Scala 2.13. However, engineering is targeting the DBR 14 release for Scala 2.13. There is no tentative date for the DBR 14 release yet, but there is usually a DBR version every 6 mo...1.

In the meantime, you may want to consider using an alternative to Databricks Connect for Scala 2.13. One possible alternative is to use the databricks-connect package from PyPI2. The databricks-connect package provides an alternative way to connect to Databricks clusters from your local machine. You can use the package to initialize a connection based on a Config object from the Databricks SDK. The DatabricksSession.builder.sdkConfig(config).getOrCreate() method can be used to create a session...2.

I hope this helps!

Ishmael
New Contributor III

Kaniz do you mean using this python library in scala? I did a quick google search and it seems this is possible. Is this what you mean? It seems ScalaPy is a library that allows this. Is this the library that you recommend? Thanks again.

Kaniz
Community Manager
Community Manager

Hi @Ishmael, Yes, you are correct. ScalaPy is a library that enables seamless interoperability between Scala and Python. It is based on the Py4J project, which allows Python programs running in a Python interpreter to dynamically access Java objects in a Java Virtual Machine. ScalaPy is designed to be easy to use and integrate with existing Scala and Python code. You can find more information and examples on how to use ScalaPy on its [official website]1 or its [GitHub repository]2. I hope this helps! 😊.

Ishmael
New Contributor III

Thank you very much @Kaniz . I'll try this out.

Kaniz
Community Manager
Community Manager
Sure!!! Please come back and let us know how it helped you.
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.