501 - not implemented
501 - not implemented

Reputation: 2688

hbase store multiple values for one key

I'm new in hbase and want to save multiple values for a row key in hbase. Is this possible? For example

RowKey | Values

1212   | 12

1213   | 12, 13, 14

Upvotes: 1

Views: 2067

Answers (1)

Alexander Kuznetsov
Alexander Kuznetsov

Reputation: 3112

Yes this is possible. You can think of HBase data model as several nested maps. Map<RowKey, Map<ColumnFamilyKey, <Map<ColumnKey, <Map<Version, Value>>>>. All kyes, as a value, have type byte arrays, except version which should be long number (64bit integer). The number and values of Column Families should be predefined for table and should not exceed 3-4 due to performance issue. From this you have two variants to store multiples values per row: in different columns or in single column with different versions. Version should be a long number.

Upvotes: 3

Related Questions