[英]Parquet file after upload to Azure Data Lake gen 2 not readable (Python)
[英]move file from azure data lake Gen 1 to a temp directory using python
如何使用 python 將文件從 azure 數據湖 Gen 1 移動到臨時目錄? 我需要在 ADL 中找到每個文件,將其移動到臨時目錄以解密並讀取它。
我在用
azure.datalake.store import core
core.AzureDLFileSystem(token, 'store_name')
#create a temp directory
with tempfile.TemporaryDirectory() as tmpdirname:
關於這個問題,請參考以下代碼
from azure.datalake.store import core, lib, multithreaded
##auth
adlCreds = lib.auth(tenant_id = tenant,
client_secret = client_secret,
client_id = client_id,
resource = RESOURCE)
subscriptionId = 'FILL-IN-HERE'
adlsAccountName = 'FILL-IN-HERE'
## Create a filesystem client object
adlsFileSystemClient = core.AzureDLFileSystem(adlCreds, store_name=adlsAccountName)
## Download a file
multithread.ADLDownloader(adlsFileSystemClient, lpath='<local path>', rpath='<path on adls>', nthreads=64, overwrite=True, chunksize=4194304,buffersize=4194304, blocksize=4194304)
##Move file between locations on ADL
adlsFileSystemClient.mv('<Source Path>','Destination path')
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.