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 <nor...@khine.net>
> To: riak-users <riak-users@lists.basho.com>
> Subject: empty list when running the mapreduce script
> Message-ID:
>        <j2g9c2c8ffb1005060049q84665e1eud61d813457461...@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@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to