Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBaseDumperBolt class not working as expected if only one column family is present. #2

Open
vandanaAgrawal opened this issue Sep 24, 2013 · 0 comments

Comments

@vandanaAgrawal
Copy link

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();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant