gpt4 book ai didi

hadoop - hadoop grep命令

转载 作者:行者123 更新时间:2023-12-02 22:06:22 34 4
gpt4 key购买 nike

谁能告诉我以下grep命令的作用:

 $ bin/hadoop jar hadoop-*-examples.jar grep input output 'dfs[a-z.]+'

最佳答案

http://wiki.apache.org/hadoop/Grep

Grep example extracts matching strings from text files and counts how many time they occured.

To run the example, type the following command:


bin/hadoop org.apache.hadoop.examples.Grep <indir> <outdir> <regex> [<group>]

The command works different than the Unix grep call: it doesn't display the complete matching line, but only the matching string, so in order to display lines matching "foo", use .foo. as a regular expression.

The program runs two map/reduce jobs in sequence. The first job counts how many times a matching string occured and the second job sorts matching strings by their frequency and stores the output in a single output file.



您是否在问正则表达式本身是什么?其余的似乎很简单。

关于hadoop - hadoop grep命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21265380/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com