Frage

I have a sample code that connects to HBase from R using RHBase (RHadoop suite). It works in one environment, does not in another.


Code:

# Location and port of the thrift server
hostLoc = '172.25.1.16'
port = 9090

require(rhbase)

#create new table with columns x,y and z
hb.new.table("mytable", "x","y","z",opts=list(y=list(compression='GZ')))

#insert some values into the table
hb.insert("mytable",list( list(10,c("x","y","z"),list("apple","berry","cherry"))))
hb.insert("mytable",list( list(20,c("x","y","z"),list(10001,14,575))))
hb.insert("mytable",list( list(30,c("x","y","z"),list("a string",1000.23,FALSE))))

This is fairly simple code, I wrote this to replicate this error.

Environment 1:

Ubuntu 12.04 LTS R: 3.0 Thrift 0.9.0 Java (if needed): OpenJDK 1.6

==> This code works fine on this environment. It is my local machine.

Environment 2 Ubuntu 12.04 LTS R: 2.15.2 Thrift 0.9.0 Java (if needed): Oracle Java 1.7

==> This is a remote machine. It throws the following error:

Error in hb.insert("mytable", list(list(10, c("x", "y", "z"), list("apple",  :
  RAW() can only be applied to a 'raw', not a 'character'

I am connecting to HBase (0.94.7) on a remote location in both instances.

Any ideas as to what is causing this problem? I'm fairly new to Hbase and the RHadoop suite, please do forgive any naive questions! Also, please do tell me if any additional info is needed.

Edit: I have a standalone instance of HBase- not the cloudera distribution. I built thrift from the source as required by RHbase

War es hilfreich?

Lösung

Revolution Analytics has recently released a third kind of serialization, 'char'. It solves this problem.

hb.init(hostloc,port,'char')
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top