The short answer is yes. Longer answer... You could do this by creating a string w a character which delineates the separation of the fields. Try using a pipe '|' character. This would be generic and work in all instances, however if your key fields are fixed length, you could just concatenate them and then parse them on their set boundaries.
Sent from a remote device. Please excuse any typos... Mike Segel On Sep 23, 2012, at 6:06 AM, John Hancock <jhancock1...@gmail.com> wrote: > 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.naraya...@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 >>