HBase "two columns in one" 功能
HBase "two columns in one" feature
下面的书暗示有一种方法可以在不使用列族的情况下将两列合二为一。它是一个实际的 HBase 功能,还是只是像 "concatenate two values in one column before sending them to Hbase and I will remember that it is in fact two columns I put there"-hack 这样的开发 hack?如果这是一个功能,它的语法是什么?
"Hadoop Application Architectures by Mark Grover, Ted Malaska,
Jonathan Seidman, and Gwen Shapira (O’Reilly)." :
[When setting two columns foo and bar to a record,] each logical
record in the HBase table will have two rows in the HBase HFile
format. Here is the structure of such an HFile on disk:
|RowKey |TimeStamp |Column |Value
|101 |1395531114 |F |A1
|101 |1395531114 |B |B1
The alternative choice is to have both the values from foo and bar in
the same HBase column. This would apply to all records of the table
and bears the following characteristics:
- Both the columns would be retrieved at the same time. You may choose to disregard the value of the other column if you don’t need
it.
- Both the column values would need to be updated together since they are stored as a single entity (column).
- Both the columns would age out together based on the last update.
Here is the structure of the HFile in such a case:
|RowKey |TimeStamp |Column |Value
|101 |1395531114 |X |A1|B1
我认为这与 and see them as "versions" of the value because here he speaks about foo and bar being two different columns with two different roles. I found no mention of such a feature in the Hbase documentation https://hbase.apache.org/book.html#schema 中将多个值放在一列中不同。
我认为您可以使用 HBase 值的值数组来执行此操作。得到数组值后,应该拆分使用。我认为没有另一种方法可以在单个列族中存储多个值。
下面的书暗示有一种方法可以在不使用列族的情况下将两列合二为一。它是一个实际的 HBase 功能,还是只是像 "concatenate two values in one column before sending them to Hbase and I will remember that it is in fact two columns I put there"-hack 这样的开发 hack?如果这是一个功能,它的语法是什么?
"Hadoop Application Architectures by Mark Grover, Ted Malaska, Jonathan Seidman, and Gwen Shapira (O’Reilly)." :
[When setting two columns foo and bar to a record,] each logical record in the HBase table will have two rows in the HBase HFile format. Here is the structure of such an HFile on disk:
|RowKey |TimeStamp |Column |Value |101 |1395531114 |F |A1 |101 |1395531114 |B |B1
The alternative choice is to have both the values from foo and bar in the same HBase column. This would apply to all records of the table and bears the following characteristics:
- Both the columns would be retrieved at the same time. You may choose to disregard the value of the other column if you don’t need it.
- Both the column values would need to be updated together since they are stored as a single entity (column).
- Both the columns would age out together based on the last update.
Here is the structure of the HFile in such a case:
|RowKey |TimeStamp |Column |Value |101 |1395531114 |X |A1|B1
我认为这与
我认为您可以使用 HBase 值的值数组来执行此操作。得到数组值后,应该拆分使用。我认为没有另一种方法可以在单个列族中存储多个值。