Note
此資訊適用於 Databricks CLI 版本 0.205 及以上。 Databricks CLI 處於 公開預覽狀態。
Databricks CLI 的使用受限於 Databricks 授權 和 Databricks 隱私權聲明,包括任何使用數據條款。
external-locations
Databricks CLI 中的指令群組包含建立及管理 Unity 目錄外部位置的指令。 請參閱什麼是 Unity Catalog 磁碟區?。
Databricks 外部位置建立
在中繼存放區中建立新的外部位置項目。 呼叫端必須是中繼存放區管理員,或具有 CREATE_EXTERNAL_LOCATION 中繼存放區和相關聯記憶體認證的許可權。
databricks external-locations create NAME URL CREDENTIAL_NAME [flags]
Arguments
NAME
外部位置的名稱。
URL
外部位置的路徑 URL。
CREDENTIAL_NAME
與這個位置搭配使用的記憶體認證名稱。
選項
--comment string
使用者提供的自由格式文字描述。
--enable-file-events
是否要在此外部儲存位置上啟用檔案事件。
--fallback
指示是否已啟用此外部位置的回退模式。
--json JSON
內嵌的 JSON 字串或 @path 整合至包含要求內容的 JSON 檔案。
--read-only
指出外部位置是否為唯讀。
--skip-validation
略過與外部位置相關聯的記憶體認證驗證。
Examples
下列範例會建立具有批注的外部位置:
databricks external-locations create my-external-location s3://my-bucket/path my-credential --comment "External location for data lake"
下列範例將建立一個唯讀的外部位置:
databricks external-locations create my-external-location s3://my-bucket/path my-credential --read-only
databricks 外部位置刪除
從中繼存放區刪除指定的外部位置。 呼叫端必須是外部位置的擁有者。
databricks external-locations delete NAME [flags]
Arguments
NAME
外部位置的名稱。
選項
--force
即使有相依的外部數據表或掛接,仍強制刪除。
Examples
下列範例會刪除名為 my-external-location的外部位置:
databricks external-locations delete my-external-location
下列範例會強制刪除外部位置,即使有相依性:
databricks external-locations delete my-external-location --force
使用databricks external-locations取得資料庫外部位置信息
從中繼存放區取得外部位置。 呼叫者必須是中繼存放區管理員、外部位置的擁有者,或者是在外部位置上擁有某些許可權的使用者。
databricks external-locations get NAME [flags]
Arguments
NAME
外部位置的名稱。
選項
--include-browse
是否要在回應中包含主體只能存取部分元數據的外部位置。
Examples
下列範例會取得名為 my-external-location的外部位置相關信息:
databricks external-locations get my-external-location
下列範例會取得包括瀏覽元資料的資訊:
databricks external-locations get my-external-location --include-browse
Databricks 外部位置清單
從資料中繼存放區中列出外部位置。 呼叫端必須是中繼存放區管理員、外部位置的擁有者,或具有外部位置某些許可權的使用者。 不保證陣列中的元素有特定的順序。
databricks external-locations list [flags]
選項
--include-browse
是否要在回應中包含主體只能存取部分元數據的外部位置。
--include-unbound
是否要包含不綁定在工作區的外部位置。
--max-results int
要傳回的外部位置數目上限。
--page-token string
不透明分頁令牌會根據上一個查詢移至下一頁。
Examples
下列範例會列出所有外部位置:
databricks external-locations list
下列範例會列出最多 10 個結果的外部位置:
databricks external-locations list --max-results 10
databricks 外部位置更新
更新中繼存放區中的外部位置。 呼叫端必須是外部位置的擁有者,或是中繼存放區管理員。在第二個案例中,系統管理員只能更新外部位置的名稱。
databricks external-locations update NAME [flags]
Arguments
NAME
外部位置的名稱。
選項
--comment string
使用者提供的自由格式文字描述。
--credential-name string
與這個位置搭配使用的記憶體認證名稱。
--enable-file-events
是否要在此外部儲存位置上啟用檔案事件。
--fallback
指示是否已啟用此外部位置的回退模式。
--force
即使變更 URL 使相依的外部數據表或掛接失效,仍強制更新。
--isolation-mode IsolationMode
支援的值:ISOLATION_MODE_ISOLATED、ISOLATION_MODE_OPEN
--json JSON
內嵌的 JSON 字串或 @path 整合至包含要求內容的 JSON 檔案。
--new-name string
外部位置的新名稱。
--owner string
外部位置的擁有者。
--read-only
指出外部位置是否為唯讀。
--skip-validation
略過與外部位置相關聯的記憶體認證驗證。
--url string
外部位置的路徑 URL。
Examples
下列範例會重新命名外部位置:
databricks external-locations update my-external-location --new-name my-renamed-location
以下示例顯示如何變更外部位置的擁有者:
databricks external-locations update my-external-location --owner someone@example.com
全域旗標
--debug
是否要啟用偵錯記錄。
-h 或 --help
顯示 Databricks CLI、相關命令群組或相關命令的幫助說明。
--log-file 字串
字串,表示要寫入輸出記錄檔的檔案。 若未指定此旗標,則預設值是將輸出記錄寫入 stderr。
--log-format 格式
記錄格式類型或 textjson。 預設值是 text。
--log-level 字串
表示日誌格式層級的字串。 若未指定,則日誌的格式層級功能將被停用。
-o, --output 類型
指令輸出類型或 textjson。 預設值是 text。
-p, --profile 字串
要用來執行命令之檔案中的 ~/.databrickscfg 配置檔名稱。 如果未指定此旗標,則如果存在,則會使用名為 DEFAULT 的配置檔。
--progress-format 格式
顯示進度記錄的格式:default、、appendinplace、 或json
-t, --target 字串
如果適用,要使用的套件組合目標