简体   繁体   中英

nested Rowkey in Hbase tables

i have a weather data base with 4 tables : province,city,station, instantHarvestinfo,dailyHarvestInfo and the relation between tables is parent-child: (province,city): R(1,m) (city,station):R(1,m) (statin,istantharvestInfo):R(1,m) (station,dailyHarvestInfo):R(1,m) i want put all of them in one bigtable in hbase and for echa one create a column family..but i dont know how define my row key...i think i need a nested row key that in each step get a split of my rowkey that related a comuln family and give me information of same cf..but how i cant define it? please help me

there.

I guess you are going to save huge amount of istantharvestInfo and dailyHarvestInfo for each station.

Since there is parent-child relationship in your data model, I think you could

design the schema as:

-------------------------------------------------------------------------
**Row-Key**:              Province + city + station + timestamp 
--------+---------------------+------------------------------------------
Family  | Qualifier           |          Value
--------+---------------------+------------------------------------------
        | istantharvestInfo   |        "value of istantInfo"
   F    +---------------------+------------------------------------------ 
        | dailyHarvestInfo    |        "value of dailyInfo"
--------+---------------------+------------------------------------------

Note that there is only one Family, because we should always make #family as small as possible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM