Is it possible to read pdf/audio/video files(unstructured data) using Apache Spark?

匿名 (未验证) 提交于 2019-12-03 02:30:02

问题:

Is it possible to read pdf/audio/video files(unstructured data) using Apache Spark? For example, I have thousands of pdf invoices and I want to read data from those and perform some analytics on that. What steps must I do to process unstructured data?

回答1:

Yes, it is. Use sparkContext.binaryFiles to load files in binary format and then use map to map value to some other format - for example, parse binary with Apache Tika or Apache POI.

Pseudocode:

val rawFile = sparkContext.binaryFiles(... val ready = rawFile.map ( here parsing with other framework 

What is important, parsing must be done with other framework like mentioned previously in my answer. Map will get InputStream as an argument



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!