databricks configure using cmd and R

[亡魂溺海] 提交于 2020-05-07 09:17:09

问题


I am trying to use databricks cli and invoke the databricks configure That's how I do it from cmd

  somepath>databricks configure --token
  Databricks Host (should begin with https://): my_https_address 
  Token: my_token

I want to invoke the same command using R. So I did:

  tool.control <- c('databricks configure --token'
                    ,'my_https_address'
                    ,'my_token')

 shell(tool.control)

I get the following error

  Error in system(command, as.integer(flag), f, stdout, stderr, timeout) : 
  character string expected as first argument

How can I correct it?

EDIT: After trying the suggestion in the comment, I get this error:

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

回答1:


Steps for installing and configuring Azure Databricks CLI using cmd:

Step1: Install Python, you’ll need Python version 2.7.9 and above if you’re using Python 2 or Python 3.6 and above if you’re using Python 3.

Step2: Run pip install databricks-cli using the appropriate version of pip for your Python installation. If you are using Python 3, run pip3 install databricks-cli.

Step3: Setup authentication => To authenticate and access Databricks REST APIs, you use personal access tokens. Tokens are similar to passwords; you should treat them with care. Tokens expire and can be revoked.

  • Click the user profile icon User Profile in the upper right corner of your Azure Databricks workspace.

  • Click User Settings.

  • Go to the Access Tokens tab.

  • Click the Generate New Token button.
  • Optionally enter a description (comment) and expiration period.

  • Click the Generate button.
  • Make sure to "Copy" the generated token and store in a secure location.

Step4: Copy the URL of databricks host "https://centralus.azuredatabricks.net/" and token which created earlier step.

Step5: In cmd run "dbfs configure --token" as shown below:

dbfs configure --token
Databricks Host (should begin with https://): https://centralus.azuredatabricks.net
Token: dapi72026dsfsdfsh987hjfiu431

Step6: Successfully configured Databricks CLI using CMD.

To verify try to run "databricks fs ls", check whether you are able to see the DBFS.

Reference: Databricks CLI

Hope this helps.


If this answers your query, do click “Mark as Answer” and "Up-Vote" for the same. And, if you have any further query do let us know.



来源:https://stackoverflow.com/questions/57867156/databricks-configure-using-cmd-and-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!