I'm a novice to talend.
I'm trying to read data from hbase and make some transformations on the data in expression builder using big data batch and write the output to a file.
now i want to get the row key of the table and apply transformations on it like below,
(concat('-',cast(cus.key as string))) as id
Here key is the rowkey of hbase table which i'm drawing data from.
And im attaching the snapshot of the mapping tab.
So when i basically run my job, the key of the hbase table should be picked up so that the above transformation cast(cus.key as string)
should be applied on the rowkey and stored as a column id.
I want to know whether do we have any easy method to get the rowkey from the hbase table?
Thanks in advance.
First of all you need to create a custom rowkey (in the hbaseoutput option) when you load your data in Hbase.
You can use some ID field in order to make it unique like
"key"+user_id
.Follow this : Here
At the same time you do that, store the same value (
"key"+user_id
) in a column that you namerow_key_technical
(for example)Now you can use the rowkey like a normal column in your table. So with an thbaseinput you can retreive the rowkey store in the technical column and do whatever you want.
You need to do it in two time.
I'm not sure this is the only solution but it's one. Mybe someone have a better solution ;) .