libraries
Operations on a libraries
resource.
Overview
Name | libraries |
Type | Resource |
Id | databricks_workspace.compute.libraries |
Fields
Name | Datatype |
---|---|
cluster_id | string |
library_statuses | array |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
allclusterlibrarystatuses | SELECT | deployment_name | Get 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. |
clusterstatus | SELECT | cluster_id, deployment_name | Get 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: |
install | INSERT | deployment_name | Add libraries to install on a cluster. The installation is asynchronous; it happens in the background after the completion of this request. |
uninstall | DELETE | deployment_name | Set 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
- libraries (allclusterlibrarystatuses)
- libraries (clusterstatus)
SELECT
cluster_id,
library_statuses
FROM databricks_workspace.compute.libraries
WHERE deployment_name = '{{ deployment_name }}';
SELECT
cluster_id,
library_statuses
FROM databricks_workspace.compute.libraries
WHERE cluster_id = '{{ cluster_id }}' AND
deployment_name = '{{ deployment_name }}';
INSERT
example
Use the following StackQL query and manifest file to create a new libraries
resource.
- libraries
- Manifest
/*+ create */
INSERT INTO databricks_workspace.compute.libraries (
deployment_name,
data__cluster_id,
data__libraries
)
SELECT
'{{ deployment_name }}',
'{{ cluster_id }}',
'{{ libraries }}'
;
- name: your_resource_model_name
props:
- name: cluster_id
value: 1234-56789-abcde
- name: libraries
value:
- pypi:
package: numpy
repo: http://my-pypi-repo.com
- jar: /Workspace/path/to/library.jar
- whl: /Workspace/path/to/library.whl
- maven:
coordinates: com.databricks:spark-csv_2.11:1.5.0
exclusions:
- org.slf4j:slf4j-log4j12
repo: http://my-maven-repo.com
- cran:
package: ggplot2
repo: http://cran.us.r-project.org
- requirements: /Workspace/path/to/requirements.txt
DELETE
example
Deletes a libraries
resource.
/*+ delete */
DELETE FROM databricks_workspace.compute.libraries
WHERE deployment_name = '{{ deployment_name }}';