In Hadoop ‘grep’ example (that comes with the Hadoop package) what is the group parameter.Can you give me an example for that.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Disclaimer: I haven’t run this example and am pulling answering after just looking at http://wiki.apache.org/hadoop/Grep
The CLI call is:
bin/hadoop org.apache.hadoop.examples.Grep <indir> <outdir> <regex> [<group>]and you want to know about<group>.I suspect this is grouping in regex. (random link – http://www.exampledepot.com/egs/java.util.regex/Group.html)
As noted on the Hadoop Grep link
What I take from this is that if you specify the
<group>value (a number) it will output only the value for that group.For an example (pulling from the Group link)
If the value for
<group>is1then the result would bea. Group 0 is the full match, not the original string, In this case it just happens to be the same.hth