Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

rhbase hb.insert.data.frame error

155 views
Skip to first unread message

该走了

unread,
Dec 27, 2013, 12:33:30 AM12/27/13
to rha...@googlegroups.com
Hi, everyone I am new to use rhbase, and I met some problem, I try to run a simple example from rhbase like
library(rhbase)
hb
.init()
hb
.new.table('testtable','x','y','z')
hb
.describe.table('testtable')
# Not required to labels to be 'family:label', can just provide 'family'
# which is equivalent to 'family:'
hb
.insert("testtable",list(list("20100101",c("x:a","x:f","y","y:w"), list("James Dewey",TRUE, 187.5,189000))))
hb
.insert("testtable",list(list("20100102",c("x:a"), list("James Agnew"))))
hb
.insert("testtable",list(list("20100103",c("y:a","y:w"), list("Dilbert Ashford",250000))))
hb
.insert("testtable",list(list("20100104",c("x:f"), list("Henry Higs"))))


hb
.get("testtable",list("20100101","20100102"))
hb
.get("testtable",list("20100101","20100102"),c("y")) # columns that start with y
hb
.get("testtable",list("20100101","20100102"),c("y:w"))
hb
.get("testtable",list("20100101","20100102"),c("y:w","z"))


# delete
hb
.delete("testtable","20100103","y:a")
hb
.get("testtable","20100103")

## will not get 20100103, since no 'x'
iter
<- hb.scan("testtable",startrow="20100100",colspec="x")
while( length(row <- iter$get(1))>0){
 
print(row)
}
iter$close
()

# scan from beginning
iter
<- hb.scan("testtable",startrow="20100100",colspec=c('x','y','z'))
while( length(row <- iter$get(1))>0){
 
print(row)
}
iter$close
()

# scan uptil 20100103 (not including it)
iter
<- hb.scan("testtable",startrow="20100100",end="20100103",colspec=c('x','y'))
while( length(row <- iter$get(1))>0){
 
print(row)
}
iter$close
()


# Insert a data frame
x
<- data.frame(x=c("Winston","Jen","Jasmine"), y=runif(3),z=c(1,2,3))
rownames
(x) <- c("20100105","20100106","20100107")
hb
.insert.data.frame("testtable",x)

everything goes fine, but when I try to hb.insert.data.frame, I got an  error:
hb.insert.data.frame("testtable",x)
Error in hb.insert.data.frame("testtable", x) : 
  rhbase<addAndSendDFBatch>:: Internal error processing mutateRows

Is there any one know how to fix it, thanks in advance!

thrift 0.91
hbase 0.96
hadoop 2.2.0






David Champagne

unread,
Dec 28, 2013, 2:47:51 PM12/28/13
to rha...@googlegroups.com
Not sure why you are seeing this error.  Can you run your test on a new hbase table instead of using 'testtable'
Reply all
Reply to author
Forward
0 new messages