Support Questions
Find answers, ask questions, and share your expertise

How to create Single DataFrame for multiple Phoenix (HBase tables) in Java ?


I have a scenario where I have multiple HBase tables on Phoenix and I have to create a single dataframe from these multiple Phoenix tables? Can anyone please provide me the solution to achieve this using Java ?


you can read the data from Phoenix using phoenix-spark connector and the using spark native APIs , you can join (or union) those data frames into single data frame.

Thanks, I have already used this approach.

Dataset<Row> df = null;

Dataset<Row> hbaseDf = null;

for (number of hbase tables){

hbaseDf = createDataFrameFromHbaseTable(hbaseTable);

if(df != null) { df = df.union(hbaseDf); } else { df = hbaseDf; }


Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.