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.

Multiple attributes or SOLR to query HBASE elements

Highlighted

Multiple attributes or SOLR to query HBASE elements

New Contributor

Hi all,

I'm a newbie in the hadoop environment and i would like to know your opinion about search methods to use.

For now, i'm wokring on a project using a HBase database with tables based on this structure :
-> create ‘<table name>’,’<column family>’.

For my example, the table is named MY_TABLE and the one family used MY_FAMILY.
By default, there is only one column COL1 for my family MY_FAMILY.

In my example, i will put an XML file into COL1 with this structure :
"<?xml version="1.0" encoding="UTF-8"?>
<breakfast_menu>
    <food>
        <name>Belgian Waffles</name>
        <price>$5</price>
        <calories>900</calories>
    </food>
    <food>
        <name>Strawberry Belgian Waffles</name>
        <price>$6</price>
        <calories>900</calories>
    </food>
</breakfast_menu>"

The HBase Shell command to add the data in the table is :
-> put ’MY_TABLE’,’ROW1’,’MY_FAMILY:COL1’,’<?xml...</food></breakfast_menu>’ (as the example above).

Using the key/value system, i can retrieve my row using the shell command :
-> get ‘MY_TABLE’, ‘ROW1’.

In my case, I need to retrieve the row(s) from MY_TABLES where the XML contains $6 as price, and 900 as calories.

According to you, what would be the better way to store and retrieve the data ?
-> Create a table with multiple columns in the family MY_FAMILY (renamed FOOD as example) with the columns name, price, calories ?
-> Use the solr engine and index the XML file to be queried ?

Thank you in advance for your advice,
Bernard.

 

 

 

 

 

1 REPLY 1

Re: Multiple attributes or SOLR to query HBASE elements

New Contributor

Do you have any feedback on multi columns search in hbase vs index in Solr ? :/