Skip to content

Instantly share code, notes, and snippets.

@lnicalo
Created July 6, 2015 19:32
Show Gist options
  • Save lnicalo/e630139be2250f1cba9f to your computer and use it in GitHub Desktop.
Save lnicalo/e630139be2250f1cba9f to your computer and use it in GitHub Desktop.
How would you do the same in python with pyspark?
I have written this piece of code but it does not work
keyConv = "org.apache.spark.examples.pythonconverters.ImmutableBytesWritableToStringConverter"
valueConv = "org.apache.spark.examples.pythonconverters.HBaseResultToStringConverter"
data_conf = {
"hbase.mapreduce.inputtable": "raw_signals",
"hbase.mapreduce.scan.columns": "family1:col1 family2:col2",
}
hbase_rdd = sc.newAPIHadoopRDD(
"org.apache.hadoop.hbase.mapreduce.TableInputFormat",
"org.apache.hadoop.hbase.io.ImmutableBytesWritable",
"org.apache.hadoop.hbase.client.Result",
keyConverter=keyConv,
valueConverter=valueConv,
conf=data_conf)
@wjymath
Copy link

wjymath commented Aug 3, 2017

hello, I meet the same problem with you with python. I guess something goes wrong with the code " valueConv = "org.apache.spark.examples.pythonconverters.HBaseResultToStringConverter" ", have you solved this problem? thank you ~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment