Skip to content

Instantly share code, notes, and snippets.

@yko
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yko/6331253c850a7a2c36fa to your computer and use it in GitHub Desktop.
Save yko/6331253c850a7a2c36fa to your computer and use it in GitHub Desktop.
http_proxy= curl -X POST -H "content-type: application/json" \
http://localhost:8098/mapred --data @-<<\EOF
{"inputs":[["welcome","german"]]
,"query":[{"map":{"language":"perl","source":"
sub {
my ($m) = lc(shift->{values}[0]{data}) =~ /(\w*)/;
my @r
for my $i (@$m) {
if($i ne '') {
push @r, { $i => 1 };
}
}
return \@r;
}
"}},{"reduce":{"language":"perl","source":"
sub {
...
}
"}}]}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment