我有一个运行 eLevelDB 后端的 Riak DB,当我使用这个 map reduce 进行查询时,我将所有数据作为 JSON 字符串返回(如预期的那样):
{
"inputs":"TWEETS_BY_ID",
"query":[
{"map":
{"language":"javascript",
"name":"Riak.mapValuesJson"
}
}]
}
这个查询很慢,我真的只想查询整个存储桶的一小部分。我有一个带有时间戳的二级索引,所以我尝试运行这个 mapreduce:
{
"inputs":
{
"bucket":"TWEETS_BY_ID",
"index":"timestamp_int",
"start":"1375736484000",
"end":"1375736485000"
},
"query":[
{"map":
{"language":"javascript",
"name":"Riak.mapValuesJson",
"keep":true
}
}
]
}
我收到此错误:
{error,{exit,{json_encode,{bad_term,{1375736484000,<<"364491348659142656">>}}},
[{mochijson2,json_encode,2,
[{file,"src/mochijson2.erl"},{line,149}]},
{mochijson2,'-json_encode_proplist/2-fun-0-',3,
[{file,"src/mochijson2.erl"},{line,167}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1197}]},
{mochijson2,json_encode_proplist,2,
[{file,"src/mochijson2.erl"},{line,170}]},
{mochijson2,'-json_encode_proplist/2-fun-0-',3,
[{file,"src/mochijson2.erl"},{line,167}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1197}]},
{mochijson2,json_encode_proplist,2,
[{file,"src/mochijson2.erl"},{line,170}]},
{mochijson2,'-json_encode_array/2-fun-0-',3,
[{file,"src/mochijson2.erl"},{line,157}]}]}}
我确实升级到了今天发布的 1.4.1,并且有一个关于二级索引和 Javascript mapreduces 的错误报告,但这似乎并没有改变我的错误。我什至不确定如何开始调试它。有什么建议么?