mapreduce

Andrea Campolonghi acampolonghi at gmail.com
Tue Nov 9 14:40:07 EST 2010


Thanks Kevin.

I am testing in this way and I submit this:

{

  "inputs": "bucket",

  "query": [

     {

      "map": {

        "language": "javascript",

        "source": "function(value, keyData, arg){var data =
Riak.mapValuesJson(value)[0];if(data.expires == 0){return [value.key];}}",

"keep":true

      }

    }

  ]

}


As result I get a generic error like :


{"lineno":483,"message":"JSON.parse","source":"unknown"}


I am having hard time to find a way to debug this.


Any suggestion?


Thanks


Andrea


2010/11/9 Kevin Smith <ksmith at basho.com>

> That is the JSON format for a MapReduce job. You need to POST it to the
> mapred end point like so:
>
> curl -XPOST -H"content-type=application/json" -d -
> http://localhost:8098/mapred
>
> --Kevin
> On Nov 9, 2010, at 5:54 AM, Andrea Campolonghi wrote:
>
> > I am testing the riak mapreduce syntax.
> >
> > I am using the default bucket and I am sure I have something inside in
> json format.
> >
> > curl -v GET http://localhost:8098/riak/bucket/susi
> >
> > get me back :
> >
> >
> {"idleTime":0,"expires":0,"timeIdle":0,"created":1289247328234,"hits":0,"lastModified":1289247328234,"exprires":1289247328234,"value":"'Susanne'","lifeSpan":0}
> >
> > Now When I try to run this from the riak console I do  not get any
> result:
> >
> >
> {"input":"bucket","query":[{"map":{"language":"javascript","source":"function(v)
> { return [v]; }","keep":true}}]};
> >
> > Any suggestion?
> >
> > Thanks
> >
> > --
> > Andrea Campolonghi
> >
> > Cell : +39 347 2298435
> > andrea at andreacfm.com
> > http://www.andreacfm.com
> >
> > Railo Team
> > andrea at getrailo.org
> > http://getrailo.org
> >
> >
> > _______________________________________________
> > riak-users mailing list
> > riak-users at lists.basho.com
> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>


-- 
Andrea Campolonghi

Cell : +39 347 2298435
andrea at andreacfm.com
http://www.andreacfm.com

Railo Team
andrea at getrailo.org
http://getrailo.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20101109/69cdb64d/attachment.html>


More information about the riak-users mailing list