pavibhai commented on a change in pull request #668:
URL: https://github.com/apache/orc/pull/668#discussion_r610754200
##########
File path: java/core/src/java/org/apache/orc/impl/RecordReaderImpl.java
##########
@@ -1302,25 +1427,33 @@ private int findStripe(long rowNumber) {
throw new IllegalArgumentException("Seek after the end of reader range");
}
- public OrcIndex readRowIndex(int stripeIndex, boolean[] included,
- boolean[] sargColumns) throws IOException {
- // if this is the current stripe, use the cached objects.
- if (stripeIndex == currentStripe) {
- return planner.readRowIndex(
- sargColumns != null || sargApp == null
- ? sargColumns : sargApp.sargColumns, indexes);
+ private void readCurrentStripeRowIndex() throws IOException {
+ planner.readRowIndex(rowIndexColsToRead, indexes);
+ }
+
+ public OrcIndex readRowIndex(int stripeIndex,
+ boolean[] included,
+ boolean[] readCols) throws IOException {
+ // Use the cached objects if the read request matches the cached request
+ if (stripeIndex == currentStripe
+ && (readCols == null || Arrays.equals(readCols,
rowIndexColsToRead))) {
+ if (rowIndexColsToRead != null) {
+ return indexes;
+ } else {
+ return planner.readRowIndex(readCols, indexes);
+ }
} else {
StripePlanner copy = new StripePlanner(planner);
if (included == null) {
included = new boolean[schema.getMaximumId() + 1];
Arrays.fill(included, true);
}
copy.parseStripe(stripes.get(stripeIndex), included);
- return copy.readRowIndex(sargColumns, null);
+ return copy.readRowIndex(readCols, null);
}
}
- private void seekToRowEntry(BatchReader reader, int rowEntry)
+ private void seekToRowEntry(BatchReader reader, int rowEntry,
EnumSet<TypeReader.ReadLevel> readLevel)
Review comment:
This is still needed as we do two types of seeks within RecordReader one
for just the filter columns and the other that performs only the non-filter
columns when the RecordReader readLevel says filter columns only.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]