Skip to content

Commit 9d03c92

Browse files
committed
fixed error on reaching end of corpus in column sets
1 parent f346c59 commit 9d03c92

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/main/java/storage/ColumnSet.java

+13-9
Original file line numberDiff line numberDiff line change
@@ -234,14 +234,18 @@ private Map<Integer, Map<String, String>> getRle(Collection<Integer> rowIndices)
234234
int currentIndex = 0;
235235
int posInRleInMem = 0;
236236
for (int index : rowIndices) {
237-
Map<String, String> row = new LinkedHashMap<>();
238-
while (currentIndex <= index) {
239-
lastVal = rleInMem[posInRleInMem++];
240-
currentIndex += rleInMem[posInRleInMem++];
237+
try {
238+
Map<String, String> row = new LinkedHashMap<>();
239+
while (currentIndex <= index) {
240+
lastVal = rleInMem[posInRleInMem++];
241+
currentIndex += rleInMem[posInRleInMem++];
242+
}
243+
row = numericValueToRowMap(lastVal);
244+
//row.put("i", Integer.toString(index));
245+
rows.put(index, row);
246+
} catch (Exception e){
247+
LOG.debug("Spooled off end of corpus");
241248
}
242-
row = numericValueToRowMap(lastVal);
243-
//row.put("i", Integer.toString(index));
244-
rows.put(index, row);
245249
}
246250

247251
return rows;
@@ -261,10 +265,10 @@ private Map<Integer, Map<String, String>> getNonRle(Collection<Integer> rowIndic
261265
//int numericValue = buf.getInt(index*4);
262266
row = numericValueToRowMap(numericValue);
263267
//row.put("i", Integer.toString(index));
268+
rows.put(index, row);
264269
} catch (Exception e) {
265-
e.printStackTrace();
270+
LOG.debug("Spooled off end of corpus");
266271
}
267-
rows.put(index, row);
268272
}
269273

270274
fc.close();

0 commit comments

Comments
 (0)