You can force your HbaseInput component to fetch the rowkey of the Hbase table.
Do the following, go the location where you have the tHbaseInput class exists.
C:\Program Files
(x86)\Talend-Studio\studio\plugins\org.talend.designer.components.mrprovider_6.2.1.20160704_1411\components\tHBaseInput
And in the tHBaseInput_mrcode_main_only java jet class,
There will be a method validateResult(), like below
public boolean validateResult(org.apache.hadoop.hbase.client.Result result,
<%=recordStruct%> value) throws IOException {
org.apache.hadoop.hbase.io.ImmutableBytesWritable rowKey = new org.apache.hadoop.hbase.io.ImmutableBytesWritable();
rowKey.set(result.getRow());
lastSuccessfulRow = rowKey.get();
byte[] rowResult = null;
String temp = null;
<%
for (int i = 0; i < mapping.size(); i++) {
Map<String, String> map = mapping.get(i);
String family_column= map.get("FAMILY_COLUMN");
IMetadataColumn column = mainColumns.get(i);
String columnName = column.getLabel();
String defaultValue = column.getDefault();
String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable());
JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType());
String patternValue = column.getPattern() == null || column.getPattern().trim().length() == 0 ? null : column.getPattern();
boolean isPrimitiveType = JavaTypesManager.isJavaPrimitiveType(javaType, column.isNullable());
String toAssign = "value." + columnName;
%>
rowResult = result.getValue(
org.apache.hadoop.hbase.util.Bytes.toBytes(<%=family_column%>),
org.apache.hadoop.hbase.util.Bytes.toBytes("<%=column.getOriginalDbColumnName()%>"));
temp = org.apache.hadoop.hbase.util.Bytes.toString(rowResult);
Modify the above method to below
public boolean validateResult(org.apache.hadoop.hbase.client.Result result,
<%=recordStruct%> value) throws IOException {
org.apache.hadoop.hbase.io.ImmutableBytesWritable rowKey = new org.apache.hadoop.hbase.io.ImmutableBytesWritable();
rowKey.set(result.getRow());
lastSuccessfulRow = rowKey.get();
byte[] rowResult = null;
String temp = null;
value.key = org.apache.hadoop.hbase.util.Bytes.toString(lastSuccessfulRow);
<%
for (int i = 0; i < mapping.size(); i++) {
Map<String, String> map = mapping.get(i);
String family_column= map.get("FAMILY_COLUMN");
IMetadataColumn column = mainColumns.get(i);
String columnName = column.getLabel();
String defaultValue = column.getDefault();
String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable());
JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType());
String patternValue = column.getPattern() == null || column.getPattern().trim().length() == 0 ? null : column.getPattern();
boolean isPrimitiveType = JavaTypesManager.isJavaPrimitiveType(javaType, column.isNullable());
String toAssign = "value." + columnName;
%>
if(!"key".equalsIgnoreCase("<%=column.getOriginalDbColumnName()%>"))
Once done, delete the file "ComponentsCache.javacache" in C:\Program Files (x86)\Talend-Studio\studio\configuration.
And restart the talend open studio.
Now your tHbaseInput Component will fetch the row key from Hbase table.
This may not be advisable for every case, but if you are using talend open studio to generate jobs and deploy the jars elsewhere, this might be helpful.
Thanks to my project manager.