【问题标题】:Connecting DataBricks to Azure Blob Storage将 DataBricks 连接到 Azure Blob 存储
【发布时间】:2021-07-11 12:12:14
【问题描述】:

我正在尝试将 Azure Blob 存储容器装载到 DataBricks 实例,虽然装载确实有效,但它似乎没有使用存储容器。

这是我用来创建挂载的代码...

storageAccountName = 'x'
blobContainerName = 'files'
storageAccountAccessKey = 'x'

dbutils.fs.mount(
  source = f'wasbs://{blobContainerName}@{storageAccountName}.blob.core.windows.net',
  mount_point = '/mnt/files/',
  extra_configs = {'fs.azure.account.key.' + storageAccountName + '.blob.core.windows.net': storageAccountAccessKey}
)

安装似乎成功了。

然后我将文件下载到安装位置...

%sh

wget https://www.stats.govt.nz/assets/Uploads/Annual-enterprise-survey/Annual-enterprise-survey-2019-financial-year-provisional/Download-data/annual-enterprise-survey-2019-financial-year-provisional-csv.csv -P /mnt/files/

然后我列出挂载位置中的文件

%sh

ls /mnt/samplefiles/

这会显示下载的文件 (annual-enterprise-survey-2019-financial-year-provisional-csv.csv),但不会显示存储帐户中已经存在的文件,下载的文件也不会出现在存储帐户。

我在这里错过了什么?

【问题讨论】:

    标签: python-3.x azure azure-storage databricks azure-databricks


    【解决方案1】:

    我需要将 /dbfs/ 添加到安装位置。

    例如...

    ls /dbfs/mnt/samplefiles
    

    【讨论】:

      猜你喜欢
      • 2017-09-17
      • 1970-01-01
      • 2022-12-11
      • 2022-08-03
      • 1970-01-01
      • 2020-11-15
      • 2019-06-09
      • 2019-03-08
      • 2016-02-18
      相关资源
      最近更新 更多