91

使用Spark读取并分析二进制文件 | 斑斓

 6 years ago
source link: http://zhangyi.xyz/read-binary-file-using-spark/?
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
需求客户希望通过spark来分析二进制文件中0和1的数量以及占比。如果要分析的是目录,则针对目录下的每个文件单独进行分析。分析后的结果保存与被分析文件同名的日志文件中,内容包括0和1字符的数量与占比。 要求:如果值换算为二进制不足八位,则需要在左侧填充0。 可以在linux下查看二进制文件的内容。命令: 1xxd –b –c 1 filename -c 1是显示1列1个字符,-b是显示二进制 Py

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK