Reputation: 2688
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
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