工作區CLI(遺留)

重要的

這個文檔已經退休了,可能不會被更新。

這個信息適用於遺留數據磚CLI版本0.17及以下。磚建議你使用新磚CLI的版本0.200及以上。看到磚CLI。找到你的版本的磚CLI,運行- v

遺留在磚磚CLI不可用的穀歌雲。

你跑磚工作區CLI子命令通過添加工作空間。這些子命令調用工作區API

磚工作區- h
用法:磚工作區[選項]命令(ARGS)……實用與磚工作區。工作區路徑必須是絕對的,與“/”前綴。常見的選項:- v,——版本(版本)- h,幫助顯示此消息並退出。命令:delete刪除對象從磚工作區。rm和刪除是同義詞。選項:- r、從磚——遞歸出口出口文件工作區。選項:- f,格式格式的源,HTML, JUPYTER或DBC。默認設置為源。- o,覆蓋覆蓋文件作為工作區具有相同名稱的文件。 export_dir Recursively exports a directory from the Databricks workspace. Options: -o, --overwrite Overwrites local files with the same names as workspace files. import Imports a file from local to the Databricks workspace. Options: -l, --language LANGUAGE SCALA, PYTHON, SQL, R [required] -f, --format FORMAT SOURCE, HTML, JUPYTER, or DBC. Set to SOURCE by default. -o, --overwrite Overwrites workspace files with the same names as local files. import_dir Recursively imports a directory to the Databricks workspace. Only directories and files with the extensions .scala, .py, .sql, .r, .R, .ipynb are imported. When imported, these extensions are stripped off the name of the notebook. Options: -o, --overwrite Overwrites workspace files with the same names as local files. -e, --exclude-hidden-files list Lists objects in the Databricks workspace. ls and list are synonyms. Options: --absolute Displays absolute paths. -l Displays full information including ObjectType, Path, Language ls Lists objects in the Databricks workspace. ls and list are synonyms. Options: --absolute Displays absolute paths. -l Displays full information including ObjectType, Path, Language mkdirs Makes directories in the Databricks workspace. rm Deletes objects from the Databricks workspace. rm and delete are synonyms. Options: -r, --recursive

刪除一個對象從一個工作空間

顯示使用文檔,運行工作空間刪除——幫助工作空間rm——幫助

磚的工作區中刪除——遞歸“/用戶/ someone@example.com/My文件夾”

或者:

磚工作區rm——遞歸“/用戶/ someone@example.com/My文件夾”

如果成功,沒有顯示輸出。

出口一個文件從一個工作空間到您的本地文件係統

顯示使用文檔,運行工作空間出口——幫助

磚的工作區出口——覆蓋JUPYTER格式“Python /用戶/ someone@example.com/My筆記本”/用戶/我/下載

這個選項也可以用於出口的筆記本磚回購:

磚的工作區出口“回購/ someone@example.com/MyRepoNotebook”/用戶/我/下載

如果成功,沒有顯示輸出。

出口從工作區目錄到您的本地文件係統

顯示使用文檔,運行工作空間export_dir——幫助

磚工作區export_dir——覆蓋/用戶/ someone@example.com/my-folder /用戶/我/下載/文件夾
/用戶/ someone@example.com/my-folder/My Python筆記本- > /用戶/我/下載/文件夾/ Python Notebook.py/用戶/ someone@example.com/my-folder/My Scala筆記本- > /用戶/我/下載/文件夾/ Scala Notebook.scala/用戶/ someone@example.com/my-folder/My R筆記本- > /用戶/我/下載/文件夾/ R Notebook.r/用戶/ someone@example.com/my-folder/My SQL筆記本- > /用戶/我/下載/文件夾/ SQL Notebook.sql

將一個文件從您的本地文件係統導入一個工作區

顯示使用文檔,運行工作空間進口——幫助

隻有文件擴展. scala,. py,. sql,r,。R可以進口。當進口時,這些擴展是剝奪了筆記本的名字。

磚工作區導入。/。py /用戶/ someone@example.com/example
,/。py - > /用戶/ someone@example.com/example/a

從本地文件係統目錄導入到工作區中

顯示使用文檔,運行工作空間import_dir——幫助

這個命令遞歸目錄從本地文件係統導入工作區。隻有目錄和文件擴展名. scala,. py,. sql,r,。R都是進口的。當進口時,這些擴展是剝奪了筆記本的名字。

目標路徑覆蓋現有的筆記本電腦,添加標記——覆蓋- o

├──a.py├──b.scala├──c.sql├──d.R└──e
磚工作區import_dir。/用戶/ someone@example.com/example
,/。py - > /用戶/ someone@example.com/example/a/ b。scala - > /用戶/ someone@example.com/example/b/ c。sql - > /用戶/ someone@example.com/example/c/ d。R - > /用戶/ someone@example.com/example/d
磚工作區ls /用戶/ someone@example.com/example - l
筆記本一個PYTHON筆記本b SCALA筆記本c SQL筆記本d R目錄e

工作空間中的對象列表

顯示使用文檔,運行工作空間列表——幫助工作空間ls——幫助

磚的工作空間的列表——絕對——長——id /用戶/ someone@example.com

或者:

磚工作區ls——絕對——長——id /用戶/ someone@example.com
筆記本/用戶/ Python筆記本Python 1234567898012345 someone@example.com/My筆記本/用戶/ someone@example.com/My Scala筆記本Scala 2345678980123456筆記本/用戶/ someone@example.com/My筆記本R 3456789801234567目錄/用戶/ 4567898012345678 someone@example.com/My目錄MLFLOW_EXPERIMENT /用戶/ 5678980123456789 someone@example.com/My_Experiment

在工作區中創建一個目錄

顯示使用文檔,運行工作空間mkdir——幫助

磚工作區mkdir“新文件夾/用戶/ someone@example.com/My”

如果成功,沒有顯示輸出。