Skip to content

Commit

Permalink
Use a constant for empty page
Browse files Browse the repository at this point in the history
  • Loading branch information
mbasmanova committed Dec 10, 2019
1 parent b526246 commit 3938c79
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public class OrcSelectiveRecordReader
{
// Marks a SQL null when occurring in constantValues.
private static final byte[] NULL_MARKER = new byte[0];
private static final Page EMPTY_PAGE = new Page(0);

private final int[] hiveColumnIndices; // elements are hive column indices
private final List<Integer> outputColumns; // elements are hive column indices
Expand Down Expand Up @@ -370,7 +371,7 @@ public Page getNextPage()

if (positionCount == 0) {
batchRead(batchSize);
return new Page(0);
return EMPTY_PAGE;
}

positionsToRead = outputPositions;
Expand Down Expand Up @@ -412,7 +413,7 @@ public Page getNextPage()
batchRead(batchSize);

if (positionCount == 0) {
return new Page(0);
return EMPTY_PAGE;
}

if (filterFunctionsWithInputs.isEmpty() && filterFunctionWithoutInput.isPresent()) {
Expand Down

0 comments on commit 3938c79

Please sign in to comment.