There are different ways to install libraries in Databricks for e.g. using the GUI, Databricks CLI etc.
I'm interested in knowing if it is possible to install Maven libraries through "%sh" commands in a Notebook. For example one option to do this from within a Notebook for Python libraries would be:
dbutils.library.installPyPI()
Another option using "%sh" for Python libraries could be to do something like this:
%sh
sudo apt-get install python3-pip -y
pip3 install --upgrade pyodbc
Is there a corresponding "%sh" command for Maven libraries for example anything like this:
%sh
mvn install --maven-coordinates "com.microsoft.azure.kusto:spark-kusto-connector:2.0.0"
No, there is no such command to do from the inside of the notebook, and %sh
won't help here because this command will be executed only on the driver node, while the library(-ies) needs to be installed on all nodes of the cluster. You have following alternatives to install library to the cluster:
libraries
subcommand of Databricks CLI (it uses REST API under the hood)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With