Last active
December 11, 2015 11:48
-
-
Save sankars/4596115 to your computer and use it in GitHub Desktop.
Hbase Get command in Jruby that can be used in Hbase shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.hadoop.hbase.HBaseConfiguration | |
import org.apache.hadoop.hbase.util.Bytes | |
import org.apache.hadoop.hbase.client.HTable | |
import org.apache.hadoop.hbase.client.Get | |
import org.apache.hadoop.io.Text | |
conf = HBaseConfiguration.new | |
tablename = "Customer" | |
table = HTable.new(conf, tablename) | |
get = Get.new(Bytes.toBytes('0001')) | |
data = table.get(get) | |
v = Bytes.toString(data.getValue(Bytes.toBytes('D'),Bytes.toBytes('N'))) | |
print data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment