1
votes

Hi i am new to Hbase an want to ask some questions:

Suppose we have two column families in one table. cf1, cf2.

cf1 have following columns: id, name, age, email

cf2 have following columns: city,state,country

Now question is what will be they query to find cf2:city where cf1: name='xxx'

Kindly help on this. I am doing this in Java so any api which can do this ?

An answer with a detailed example will be very appreciative.

Regards

1

1 Answers

0
votes

Use the SingleColumnValueFilters. Like this.

SingleColumnValueFilter('cf2','city',=,'binary:nameofthecity') AND SingleColumnValueFilter('cf1','name',=,'binary:xxx')

. Set it to the filter in the scan object and use this scan object to get the data from the table.