11-13-2023 08:34 PM
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?
11-14-2023 12:44 AM
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! 😊.
11-13-2023 10:01 PM
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....
11-14-2023 12:19 AM
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?
11-14-2023 12:26 AM
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!
11-14-2023 12:40 AM
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.
11-14-2023 12:44 AM
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! 😊.
11-14-2023 12:53 AM
Thank you very much @Kaniz . I'll try this out.
11-14-2023 12:55 AM
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.