hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Hancock <jhancock1...@gmail.com>
Subject Re: Can we create rowkey with multiple columns
Date Sun, 23 Sep 2012 11:06:29 GMT
Ramasubramanian,

I think that you can if you know the maximum number of bytes the fields
2,3,5 are going to use.  This is easy if the fields are all primitive
types.  Judging by the names of the columns you want to use for keys, it
looks like long, long, boolean would work.

In your code use Bytes.toBytes() to convert the fields to byte arrays
individually, then use Bytes.add() to glue the fields together to become
your row key.

-John

On Sat, Sep 22, 2012 at 10:45 AM, Ramasubramanian Narayanan <
ramasubramanian.narayanan@gmail.com> wrote:

> Hi,
>
> Can we create rowkey with multiple columns? If so can u please share the
> syntax of doing the same for the below scenario.
>
> Table Name : TXNTABLE
> Columns     :
> 1) Branch
> 2) Account Number
> 3) Txn Date
> 4) Debit credit flag
> 5) Txn Reference number.
>
> In the above scenario I want to create a rowkey for the combination of
> columns 2,3 & 5
>
> regards,
> Rams
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message