Skip to main content

libraries

Operations on a libraries resource.

Overview

Namelibraries
TypeResource
Iddatabricks_workspace.compute.libraries

Fields

NameDatatype
cluster_idstring
library_statusesarray

Methods

NameAccessible byRequired ParamsDescription
allclusterlibrarystatusesSELECTdeployment_nameGet the status of all libraries on all clusters. A status is returned for all libraries installed on this cluster via the API or the libraries UI.
clusterstatusSELECTcluster_id, deployment_nameGet the status of libraries on a cluster. A status is returned for all libraries installed on this cluster via the API or the libraries UI. The order of returned libraries is as follows:
installINSERTdeployment_nameAdd libraries to install on a cluster. The installation is asynchronous; it happens in the background after the completion of this request.
uninstallDELETEdeployment_nameSet libraries to uninstall from a cluster. The libraries won't be uninstalled until the cluster is restarted. A request to uninstall a library that is not currently installed is ignored.

SELECT examples

SELECT
cluster_id,
library_statuses
FROM databricks_workspace.compute.libraries
WHERE deployment_name = '{{ deployment_name }}';

INSERT example

Use the following StackQL query and manifest file to create a new libraries resource.

/*+ create */
INSERT INTO databricks_workspace.compute.libraries (
deployment_name,
data__cluster_id,
data__libraries
)
SELECT
'{{ deployment_name }}',
'{{ cluster_id }}',
'{{ libraries }}'
;

DELETE example

Deletes a libraries resource.

/*+ delete */
DELETE FROM databricks_workspace.compute.libraries
WHERE deployment_name = '{{ deployment_name }}';