Chapter04 编写基本的MapReduce程序(二) 非JAVA语言编写mapreduce程序

Hadoop也可以使用非Java语言来编写,主要使用Streaming API编写,但只适用较小、功能比较简单的MapReduce程序。

下面是使用Shell 脚本来对被引用的专利排序:

Chapter04 编写基本的MapReduce程序(二) 非JAVA语言编写mapreduce程序

运行的结果:

Chapter04 编写基本的MapReduce程序(二) 非JAVA语言编写mapreduce程序

使用python语言编写,需要使用file参数将程序打包成作业来运行,

Chapter04 编写基本的MapReduce程序(二) 非JAVA语言编写mapreduce程序

可以看出并没有设置特定的Reducer,采用默认的IdentifyReducer,把输入直接转变为输出。