empty list when running the mapreduce script

Sean Cribbs sean at basho.com
Thu May 6 09:49:27 EDT 2010


We'll get the data fixed right away.  Thanks for the heads up!

Sean Cribbs <sean at basho.com>
Developer Advocate
Basho Technologies, Inc.
http://basho.com/

On May 6, 2010, at 8:40 AM, Barry Ezell wrote:

> Hi Norman,
> 
> I had the same issue.  The problem I found was that Riak wasn't being populated from the "load_data" script.  I believe the culprit was that the slashes in the date field are unacceptable as a Riak key.  Later tutorials expect the date to be in the format "YYYY-MM-DD" so I wrote a Ruby script to parse and save as goog2.csv.  The load_data script then worked (which I verified via curl http://127.0.0.1:8091/riak/goog).
> 
> Here's the Ruby script in case it's useful:
> 
> require 'rubygems'
> require 'fastercsv'
> 
> cout = FasterCSV.open('goog2.csv','w')
> FasterCSV.foreach('goog.csv') do |row|
>         date_parts = row[0].split('/')
>         org_date = Date.new(("20" + date_parts[2]).to_i, date_parts[0].to_i, date_parts[1].to_i)
>         mod_date = org_date.strftime("%Y-%m-%d")
> 
>         row2 = [mod_date]
>         (1..6).each { |x| row2 << row[x] }
>         cout << row2
> end
> 
> 
> Regards,
> 
> Barry Ezell
> 
>  
> Message: 5
> Date: Thu, 6 May 2010 09:49:23 +0200
> From: Norman Khine <norman at khine.net>
> To: riak-users <riak-users at lists.basho.com>
> Subject: empty list when running the mapreduce script
> Message-ID:
>        <j2g9c2c8ffb1005060049q84665e1eud61d813457461ea4 at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
> 
> hello,
> I am following the  "The Riak Fast Track " but i am getting an empty
> list when running the
> mapreduce script:
> 
> aqoon:dev khinester$ curl -X POST http://127.0.0.1:8091/mapred -H
> "Content-Type: application/json" -d @-
> {"inputs": "goog",
> "query": [{"map": {"language":"javascript",
>          "name":"Riak.mapValueJson",
>          "keep":true}}
>       ]
> }
> []aqoon:dev khinester$
> 
> i have loaded the goog.csv file as per the guide.
> 
> what am i missing?
> 
> thanks
> 
> norman
> 
> --
> ?no? u?? u?op ?p?sdn ????? u?? ? - %>>> "".join( [
> {'*':'@','^':'.'}.get(c,None) or chr(97+(ord(c)-83)%26) for c in
> ",adym,*)&uzq^zqf" ] )
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20100506/8b5b711e/attachment.html>


More information about the riak-users mailing list