Open In App

How to Install Scala packages in Databricks?

Last Updated : 16 Jan, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

In Scala, a package is a technique for grouping together classes, sub-packages, traits, and package objects. In essence, it offers a namespace so that we can place our code in various files and directories. The use of packages makes it simple to maintain our code and avoids name conflicts between members of various packages. To provide access to external or homegrown code by notebooks and processes running on your clusters, you can install a library. The construction of libraries is supported by Python, Java, Scala, and R. one can upload Java, Scala, and Python libraries and point to external packages using the PyPI, Maven, and CRAN repositories.

Installing Scala packages in Databricks

Step 1: To Build a Databricks cluster Follow the below steps.

New-cluster

 

Step 2: Pick the newly formed cluster.

Pick-newly-formed-cluster

 

Step 3: Install New ⇢ Libraries ⇢ Choose Library > Source > “Maven” ⇢ Coordinates Packages for Search ⇢ the Maven Central option ⇢ Look for the necessary package. Example: (GDAL) ⇢ Choose the necessary version (3.0.0) ⇢ Install.

Installing-library

 

Step 4: One can install a library to give notebooks and processes running on your clusters access to external or custom code. Python, Java, Scala, and R all support the creation of libraries. With the help of the PyPI, Maven, and CRAN repositories, you may upload Java, Scala, and Python libraries and reference external packages.

Searching-packages

 

Step 5: After performing step 1 for the first time, restart the cluster and the Scala packages in Databricks will be successfully installed.

Restarting-cluster

 


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads