将图像加载到猪身上

时间:2013-12-26 06:07:26

标签: hadoop apache-pig

我是使用Apache Pig分析图像的新手。 任何人都可以建议我如何加载和处理图像??

我知道文本文件,

alias = load '/user/Pavan/sample.txt' using PigStorage(" ");

如何处理图片?

1 个答案:

答案 0 :(得分:1)

你有几个选择,这取决于你想要做的操作类型:

1)编写自定义加载函数

Pig can be used for images,但你需要写一个custom load function,这可能比你想做的更多。

2)使用序列文件(我的推荐)

你也可以convert the image to a Sequence File,哪个Pig有一个加载文件,available in the Piggybank JAR。还有加载功能和存储功能,用于通过Twitter's Elephant Bird package读取和写入序列文件。

Here's an article about using Sequence Files on Hadoop for astronomical categorization tasks.

3)使用MapReduce。

根据任务的性质,您可能会更好地使用本地MapReduce。