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

Fix summarizer bug with empty loc group #707

Merged
merged 1 commit into from
Oct 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@ private static class LgSummaries {

boolean exceedsRange(Text startRow, Text endRow) {

if (summaries.length == 0) {
return false;
}

Text lastRow = summaries[summaries.length - 1].lastRow;
if (startRow != null && firstRow.compareTo(startRow) <= 0
&& startRow.compareTo(lastRow) < 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -717,13 +717,15 @@ public void testLocalityGroups() throws Exception {
SummarizerConfiguration sc1 = SummarizerConfiguration.builder(FamilySummarizer.class).build();
SummarizerConfiguration sc2 = SummarizerConfiguration.builder(BasicSummarizer.class).build();
ntc.enableSummarization(sc1, sc2);
c.tableOperations().create(table, ntc);

Map<String,Set<Text>> lgroups = new HashMap<>();
lgroups.put("lg1", ImmutableSet.of(new Text("chocolate"), new Text("coffee")));
lgroups.put("lg2", ImmutableSet.of(new Text(" broccoli "), new Text("cabbage")));
// create a locality group that will not have data in it
lgroups.put("lg3", ImmutableSet.of(new Text(" apple "), new Text("orange")));

c.tableOperations().setLocalityGroups(table, lgroups);
ntc.setLocalityGroups(lgroups);
c.tableOperations().create(table, ntc);

Map<Key,Value> expected = new HashMap<>();
try (BatchWriter bw = c.createBatchWriter(table, new BatchWriterConfig())) {
Expand Down