How to Join two tables in Hbase

我们两清 提交于 2019-12-10 07:41:39

问题


Problem:

I am new to Hbase and I came across a situation where I need to join two tables.
Let us suppose I have Employee table and Department table both are created in Hbase. By reading Hbase in action , I got to know that we cannot join tables in Hbase.

Solution:

I found out a solution that by writing MapReduce Code using Hbase classes and Interfaces we can achieve this task.

Also if someone can help me with the coding that would be very helpful


回答1:


The easiest way would be to load your HBase tables into Hive or Impala and perform a SQL join with those tools.




回答2:


You should look at this jira issue in apache. You should use MultiTableInputFormat. https://issues.apache.org/jira/browse/HBASE-3996

See also: how to join tables in hbase




回答3:


Using Hive or Impala is costly when data is to large and we face issue like Hbase kill(region server Down) . so it is convenient when data is small but not for large Data. In mapreduce take Hbase table object to take one table and by extending tablemapper use 2nd table. By this way you can join 2 tables.



来源:https://stackoverflow.com/questions/25589288/how-to-join-two-tables-in-hbase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!