【发布时间】:2020-05-26 14:12:33
【问题描述】:
我正在尝试在 Databricks 笔记本中使用 Python 从 Azure Data Lake 读取文件。 这是我使用的代码,
from azure.storage.filedatalake import DataLakeFileClient
file = DataLakeFileClient.from_connection_string("DefaultEndpointsProtocol=https;AccountName=mydatalake;AccountKey=******;EndpointSuffix=core.windows.net",file_system_name="files", file_path="/2020/50002")
with open("./sample.txt", "wb") as my_file:
download = file.download_file()
content = download.readinto(my_file)
print(content)
我得到的输出是 0。你能指出我做错了什么吗?我的期望是打印文件内容。
【问题讨论】:
标签: python azure azure-data-lake azure-databricks