89_*_*ple 0 command-line r databricks azure-databricks
我正在尝试使用 databricks cli 并调用 databricks configure 这就是我从 cmd 中执行的操作
somepath>databricks configure --token
Databricks Host (should begin with https://): my_https_address
Token: my_token
Run Code Online (Sandbox Code Playgroud)
我想使用 R 调用相同的命令。所以我做了:
tool.control <- c('databricks configure --token'
,'my_https_address'
,'my_token')
shell(tool.control)
Run Code Online (Sandbox Code Playgroud)
我收到以下错误
Error in system(command, as.integer(flag), f, stdout, stderr, timeout) :
character string expected as first argument
Run Code Online (Sandbox Code Playgroud)
我该如何纠正?
编辑:尝试评论中的建议后,我收到此错误:
Databricks Host (should begin with https://): Aborted!
'https:' is not recognized as an internal or external command,
operable program or batch file.
'my_token' is not recognized as an internal or external command,
operable program or batch file.
[[1]]
[1] 1
[[2]]
[1] 1
[[3]]
[1] 1
Warning messages:
1: In FUN(X[[i]], ...) :
'databricks configure --token' execution failed with error code 1
2: In FUN(X[[i]], ...) :
'my_https_address' execution failed with error code 1
3: In FUN(X[[i]], ...) :
'my_token' execution failed with error code 1
Run Code Online (Sandbox Code Playgroud)
使用 cmd 安装和配置 Azure Databricks CLI 的步骤:
第一步:安装Python,如果你使用Python 2,你需要Python 2.7.9及以上版本,如果你使用Python 3,则需要Python 3.6及以上版本。
步骤 2:pip install databricks-cli使用适合 Python 安装的 pip 版本运行。如果您使用的是 Python 3,请运行pip3 install databricks-cli.
第 3 步:设置身份验证 => 要对 Databricks REST API 进行身份验证和访问,您需要使用个人访问令牌。令牌类似于密码;你应该小心对待他们。令牌过期并且可以撤销。
单击 Azure Databricks 工作区右上角的用户配置文件图标用户配置文件。
单击用户设置。
转到访问令牌选项卡。
步骤 4:复制"https://centralus.azuredatabricks.net/"之前创建的 databricks 主机和令牌的 URL 。
Step5:在cmd中运行“dbfs configure --token”如下图:
dbfs configure --token
Databricks Host (should begin with https://): https://centralus.azuredatabricks.net
Token: dapi72026dsfsdfsh987hjfiu431
Run Code Online (Sandbox Code Playgroud)
步骤 6:使用 CMD 成功配置 Databricks CLI。
要验证尝试运行“databricks fs ls”,请检查您是否能够看到 DBFS。
参考: Databricks CLI