external-lineage command group
This information applies to Databricks CLI versions 0.205 and above. The Databricks CLI is in Public Preview.
Databricks CLI use is subject to the Databricks License and Databricks Privacy Notice, including any Usage Data provisions.
The external-lineage command group within the Databricks CLI contains commands to define and manage lineage relationships between Databricks objects and external systems.
databricks external-lineage create-external-lineage-relationship
Create an external lineage relationship between a Databricks or external metadata object and another external metadata object.
databricks external-lineage create-external-lineage-relationship SOURCE TARGET [flags]
Arguments
SOURCE
Source object of the external lineage relationship.
TARGET
Target object of the external lineage relationship.
Options
--json JSON
The inline JSON string or the @path to the JSON file with the request body
Examples
The following example creates an external lineage relationship using JSON:
databricks external-lineage create-external-lineage-relationship source_object target_object --json '{"column_mappings": [{"source_column": "id", "target_column": "external_id"}]}'
The following example creates an external lineage relationship using a JSON file:
databricks external-lineage create-external-lineage-relationship source_object target_object --json @lineage.json
databricks external-lineage delete-external-lineage-relationship
Delete an external lineage relationship between a Databricks or external metadata object and another external metadata object.
databricks external-lineage delete-external-lineage-relationship [flags]
Options
--json JSON
The inline JSON string or the @path to the JSON file with the request body
Examples
The following example deletes an external lineage relationship using JSON:
databricks external-lineage delete-external-lineage-relationship --json '{"source": "source_object", "target": "target_object"}'
The following example deletes an external lineage relationship using a JSON file:
databricks external-lineage delete-external-lineage-relationship --json @delete-lineage.json
databricks external-lineage list-external-lineage-relationships
List external lineage relationships of a Databricks object or external metadata given a supplied direction.
databricks external-lineage list-external-lineage-relationships [flags]
Options
--json JSON
The inline JSON string or the @path to the JSON file with the request body
--page-size int
Maximum number of external lineage relationships to return per page.
--page-token string
Token to retrieve the next page of results.
Examples
The following example lists external lineage relationships using JSON:
databricks external-lineage list-external-lineage-relationships --json '{"object": "my_catalog.my_schema.my_table", "direction": "DOWNSTREAM"}'
The following example lists external lineage relationships with pagination:
databricks external-lineage list-external-lineage-relationships --json '{"object": "my_catalog.my_schema.my_table", "direction": "UPSTREAM"}' --page-size 10
The following example lists external lineage relationships using a JSON file:
databricks external-lineage list-external-lineage-relationships --json @list-lineage.json
databricks external-lineage update-external-lineage-relationship
Update an external lineage relationship between a Databricks or external metadata object and another external metadata object.
databricks external-lineage update-external-lineage-relationship UPDATE_MASK SOURCE TARGET [flags]
Arguments
UPDATE_MASK
The field mask must be a single string, with multiple fields separated by commas (no spaces). The field path is relative to the resource object, using a dot (.) to navigate sub-fields (e.g., author.given_name). Specification of elements in sequence or map fields is not allowed, as only the entire collection field can be specified. Field names must exactly match the resource field names.
An asterisk (*) field mask indicates full replacement. It's recommended to always explicitly list the fields being updated and avoid using wildcards, as it can lead to unintended results if the API changes in the future.
SOURCE
Source object of the external lineage relationship.
TARGET
Target object of the external lineage relationship.
Options
--json JSON
The inline JSON string or the @path to the JSON file with the request body
Examples
The following example updates an external lineage relationship using JSON:
databricks external-lineage update-external-lineage-relationship "column_mappings" source_object target_object --json '{"column_mappings": [{"source_column": "updated_id", "target_column": "new_external_id"}]}'
The following example updates an external lineage relationship using a JSON file:
databricks external-lineage update-external-lineage-relationship "column_mappings" source_object target_object --json @update-lineage.json
Global flags
--debug
Whether to enable debug logging.
-h or --help
Display help for the Databricks CLI or the related command group or the related command.
--log-file string
A string representing the file to write output logs to. If this flag is not specified then the default is to write output logs to stderr.
--log-format format
The log format type, text or json. The default value is text.
--log-level string
A string representing the log format level. If not specified then the log format level is disabled.
-o, --output type
The command output type, text or json. The default value is text.
-p, --profile string
The name of the profile in the ~/.databrickscfg file to use to run the command. If this flag is not specified then if it exists, the profile named DEFAULT is used.
--progress-format format
The format to display progress logs: default, append, inplace, or json
-t, --target string
If applicable, the bundle target to use