coderz
coderz

Reputation: 4989

Why HBase RowKey, ColumnKey and value are binary values (bytes), but not String?

A HBase value is indexed by 4 keys: TableName, RowKey, ColumnKey, Timestamp.

Where:

Binary data is encoded in Base64 for transmission over the wire.

Why keys and values are stored using bytes instead of String?

Upvotes: 0

Views: 1280

Answers (1)

Robert Fišer
Robert Fišer

Reputation: 219

Because you may need to store a binary data in qualifier and value. For example we have prefixed qualifiers like this: 'prefix[binary int64 id]' and serialized protobuf as value. You can use ColumnPrefixFilter to get these value. In other case we have a column family 'i' qualifier 'binary 64int id' and value binary value. So all qualifier in this column family are binary and you can scan just this family.

Upvotes: 2

Related Questions