1

我在具有混合文件编码的 hdfs 上有一堆 100GB 文件(不幸的是在 Azure blob 存储中)。如何确定每个文件的文件编码?一些 dfs 命令行命令将是理想的。谢谢。

4

2 回答 2

2

file通过将 blob 存储中每个文件的开头通过管道传输到本地缓冲区,然后应用unix 实用程序,我最终获得了所需的结果。以下是单个文件的命令:

hdfs dfs -cat wasb://container@account.blob.core.windows.net/path/to/file | head -n 10 > buffer; file -i buffer

这会让你得到类似的东西:

buffer: text/plain; charset=us-ascii
于 2016-03-28T21:33:10.990 回答
0

您可以尝试https://azure.microsoft.com/en-us/documentation/articles/xplat-cli-install/

该命令将返回所有可用的 blob 属性azure storage blob listazure storage blob show包括 contentType、contentLength、元数据。

如果此信息不包含您想要的 - 文件编码,我认为您需要为每个文件定义/设置自己的metadata喜欢file-encoding。然后您可以通过 CLI 工具将其取回。

于 2016-03-24T01:38:25.683 回答