• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

如何运行hbase示例数据脚本“index-builder-setup.rb”?

ruby 来源:user1095131 8次浏览

hbase-0.94.0/src/examples/mapreduce/index-builder-setup.rb when i run the script,it reports error: [[email protected] mapreduce]$ ruby index-builder-setup.rb index-builder-setup.rb:18: undefined method `create’ for main:Object (NoMethodError) index-builder-setup.rb:如何运行hbase示例数据脚本“index-builder-setup.rb”?

# Set up sample data for IndexBuilder example 
create "people", "attributes" 
create "people-email", "INDEX" 
create "people-phone", "INDEX" 
create "people-name", "INDEX" 

[["1", "jenny", "[email protected]", "867-5309"], 
["2", "alice", "[email protected]", "555-1234"], 
["3", "kevin", "[email protected]", "555-1212"]].each do |fields| 
    (id, name, email, phone) = *fields 
    put "people", id, "attributes:name", name 
    put "people", id, "attributes:email", email 
    put "people", id, "attributes:phone", phone 
end 


===========解决方案如下:

我们不应该用红宝石对于这一点,因为它不知道什么是HBase的。

对于你的情况下,试试这个:

./bin/hbase shell /path-to-your-hbase-dir/src/examples/mapreduce/index-builder-setup.rb


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)