使用Hive的用户可以在数据流中插入自定义的Mappers和Reducers,为了运行自定义的Mapper和Reducer脚本,用户可以使用下面的命令,该命令使用TRANSFORM从句嵌入Mapper和Reducer脚本:
query:
FROM(
FROM src
MAPexpression (',' expression)*
(inRowFormat)?
USING 'my_map_script'
(AS colName (',' colName)* )?
(outRowFormat)?(outRecordReader)?
(clusterBy? | distributeBy? sortBy? ) src_alias
)
REDUCE expression (',' expression)*
(inRowFormat)?
USING 'my_reduce_script'
(AS colName (',' colName)* )?
(outRowFormat)?(outRecordReader)?
FROM(
FROM src
SELECT TRANSFORM '(' expression (',' expression)* ')'
(inRowForma