简体   繁体   English

databricks - 在终端 'export DATABRICKS_CONFIG_FILE="dbfs:/FileStore/tables/partition.csv' 中执行命令时无响应

[英]databricks - no response when executing command in terminal 'export DATABRICKS_CONFIG_FILE="dbfs:/FileStore/tables/partition.csv'

I am trying to export the csv file by following this guide https://docs.databricks.com/dev-tools/cli/index.html , but there's no response when executing below command, it looks like exist the command directly without saying exporting is successfully or failed.我正在尝试按照本指南https://docs.databricks.com/dev-tools/cli/index.html导出 csv 文件,但是执行以下命令时没有响应,看起来直接存在命令而不说导出成功或失败。

I have finished install the cli and setup authentication by entering a host and token in mac terminal by following the guide as well.我也按照指南在 mac 终端中输入主机和令牌,完成了 cli 和设置身份验证的安装。

export DATABRICKS_CONFIG_FILE="dbfs:/FileStore/tables/partition.csv"

please refer to this screenshot:请参考这个截图: 在此处输入图像描述 At first, I write the dataframe into file system by below code首先,我通过以下代码将 dataframe 写入文件系统

df.coalesce(1).write.mode("overwrite").csv("dbfs:/FileStore/tables/partition.csv") df.coalesce(1).write.mode("overwrite").csv("dbfs:/FileStore/tables/partition.csv")

how could i successfully export the file from databricks and where does it stored locally?我怎样才能成功地从数据块中导出文件,它在本地存储在哪里?

Yes, you can copy to your local machine or move to another destination as needed是的,您可以根据需要复制到本地机器或移动到另一个目的地

Configure azure CLI with azure databricks:使用 azure 数据块配置 azure CLI:

Please follow this steps:请按照以下步骤操作:

  • pip install databricks-cli

  • Use databricks configure --token command使用databricks configure --token命令

  • Mention Azure databricks host name : https://adb-xxxxx.azuredatabricks.net/提及 Azure databricks主机名https://adb-xxxxx.azuredatabricks.net/

  • Past your Personal Access Token .过去你的个人访问令牌

在此处输入图像描述

Now all set to export the CSV file and store it in a destination location.现在全部设置为导出 CSV 文件并将其存储在目标位置。

databricks fs cp dbfs:/FileStore/tables/partition.csv dbfs:/destination/your_folder/file.csv

databricks fs cp C:/folder/file.csv dbfs:/FileStore/folder

Or或者

If you have a lot of CSV files placed in a folder.you prefer to export the entire folder rather than individual files. CSV 如果一个文件夹中有很多文件。您更愿意导出整个文件夹而不是单个文件。

Use -r to select your folder instead of the individual file.使用-r到 select 您的文件夹而不是单个文件。

databricks fs cp -r  dbfs:/<folder>  destination/folder

Alternative approach in python: python 中的替代方法:

You can use directly dbutils.fs.cp("dbfs:/FileStore/gender_submission.csv","destination/folder")可以直接使用dbutils.fs.cp("dbfs:/FileStore/gender_submission.csv","destination/folder")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将 data.table 从 Databricks dbfs 导出到 azure sql 数据库 - Export data table from Databricks dbfs to azure sql database Databricks cli - 用于复制文件的 dbfs 命令 - Databricks cli - dbfs commands to copy files 在数据块中以 stream dataframe 的形式获取 dbfs 文件 - Fetch dbfs files as a stream dataframe in databricks 为什么从 databricks spark 笔记本(hadoop fileUtils)写入 DBFS 装载位置比写入 DBFS 根位置慢 13 倍? - Why write from databricks spark notebook ( hadoop fileUtils) to DBFS mount location is 13 times slower than write to DBFS Root location? 仅当所有表都对数据块和增量表有效时才写入 - write only when all tables are valid with databricks and delta table 查看 Databricks AWS 中的托管表 - See managed tables in Databricks AWS Azure Databricks - 与考拉一起读书的桌子 - Azure Databricks - reading tables with koalas 无法从 python 文件运行 azure 数据块 - Not able to run azure databricks from python file 在 spark 集群配置数据块中参数化 azure 存储帐户名称 - parameterize azure storage account name in spark cluster config databricks 在集群 Spark Config 中为 Azure Databricks 设置数据湖连接 - Setting data lake connection in cluster Spark Config for Azure Databricks
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM