You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For one column family, the execute function of 'HBaseDumperBolt' class does not behave as expected. Even if there are multipe rows to be inserted, it will insert only a single row in Hbase table. This is because value of ArrayList 'colFamilyValues' is not reset even after adding it to ArrayList 'colValues'. As a result, previous values in ArrayList 'colFamilyValues' are also getting added to 'colValues'. Currently the code snippet of execute function in 'HBaseDumperBolt' class is:
if (colFamilyNames.size() == 1) {
for (int j = 0; j < colNames.get(0).size(); j++) {
fieldValue = tuple.getValue(j).toString();
if (rowKeyCheck.equals(colNames.get(0).get(j))) {
rowKey = fieldValue;
}
colFamilyValues.add(fieldValue);
}
colValues.add(colFamilyValues);
}
As per my understanding, it should be:
if (colFamilyNames.size() == 1) {
for (int j = 0; j < colNames.get(0).size(); j++) {
fieldValue = tuple.getValue(j).toString();
if (rowKeyCheck.equals(colNames.get(0).get(j))) {
rowKey = fieldValue;
}
colFamilyValues.add(fieldValue);
}
colValues.add(colFamilyValues);
//Below reinitialization of 'colFamilyValues' missing.
colFamilyValues = new ArrayList();
}
The text was updated successfully, but these errors were encountered:
For one column family, the execute function of 'HBaseDumperBolt' class does not behave as expected. Even if there are multipe rows to be inserted, it will insert only a single row in Hbase table. This is because value of ArrayList 'colFamilyValues' is not reset even after adding it to ArrayList 'colValues'. As a result, previous values in ArrayList 'colFamilyValues' are also getting added to 'colValues'. Currently the code snippet of execute function in 'HBaseDumperBolt' class is:
if (colFamilyNames.size() == 1) {
for (int j = 0; j < colNames.get(0).size(); j++) {
fieldValue = tuple.getValue(j).toString();
if (rowKeyCheck.equals(colNames.get(0).get(j))) {
rowKey = fieldValue;
}
colFamilyValues.add(fieldValue);
}
colValues.add(colFamilyValues);
}
As per my understanding, it should be:
if (colFamilyNames.size() == 1) {
for (int j = 0; j < colNames.get(0).size(); j++) {
fieldValue = tuple.getValue(j).toString();
if (rowKeyCheck.equals(colNames.get(0).get(j))) {
rowKey = fieldValue;
}
colFamilyValues.add(fieldValue);
}
colValues.add(colFamilyValues);
//Below reinitialization of 'colFamilyValues' missing.
colFamilyValues = new ArrayList();
}
The text was updated successfully, but these errors were encountered: