gpt4 book ai didi

python-3.x - 使用 python 从 azure 数据湖解压缩 .gz 文件

转载 作者:行者123 更新时间:2023-12-03 02:49:25 25 4
gpt4 key购买 nike

我正在尝试解压缩存储在 azure 数据湖中的 .gz 文件。

from azure.datalake.store import core, lib

Tenant_Id = '####'
Client_Key = '####'
Client_Id = '####'
token = lib.auth(tenant_id=Tenant_Id, client_secret=Client_Key, client_id=Client_Id)

store_name = 'root'
# Connecting to adl
adl = core.AzureDLFileSystem(token, store_name=store_name)
# List of .gz files
list_of_gz_files = adl.ls('/test/2018')
# Would like to uzip files present inside list_of_gz_files list

是否可以使用 gzip 等解压缩它们?

最佳答案

此处提供 3 个选项来解压缩 ADL 中的 zip 文件。

1.使用Azure数据工厂使用copy file activity解压缩文件(对 gzip 文件的 native 支持)。

enter image description here

2.使用Custom Activity在自动输稿器中。在azure批处理中创建作业并访问数据湖以使用python代码解压文件。(使用gzip包)

3.在U-SQL中使用自定义提取器,请引用此跟踪:How to preprocess and decompress .gz file on Azure Data Lake store?

关于python-3.x - 使用 python 从 azure 数据湖解压缩 .gz 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56916780/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com