Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to lookup in Hbase using data from Hive in Spark Java

Highlighted

How to lookup in Hbase using data from Hive in Spark Java

New Contributor

I have a hive table. I am reading it in spark. I want to use one column of dataset and lookup for same in HBase.

How to do it in Spark 2 ?

Note: using Java 8

1 REPLY 1

Re: How to lookup in Hbase using data from Hive in Spark Java

Rising Star

You can do it in several ways. The easiest one is to read the HBase table with Spark HBase connector (https://github.com/hortonworks-spark/shc) and to join the two dataframes. Another option is to map you dataframe and foreach line perform a Get request to HBase. Here you can find an example of performing a Get request to HBase via Java code.