use of io.prestosql.orc.reader.ResultCachingSelectiveColumnReader in project hetu-core by openlookeng.
the class AbstractOrcRecordReader method advanceToNextRowGroup.
private boolean advanceToNextRowGroup() throws IOException {
nextRowInGroup = 0;
if (currentRowGroup >= 0) {
if (rowGroupStatisticsValidation.isPresent()) {
OrcWriteValidation.StatisticsValidation statisticsValidation = rowGroupStatisticsValidation.get();
long offset = stripes.get(currentStripe).getOffset();
writeValidation.get().validateRowGroupStatistics(orcDataSource.getId(), offset, currentRowGroup, statisticsValidation.build().get());
statisticsValidation.reset();
}
}
while (!rowGroups.hasNext() && currentStripe < stripes.size()) {
advanceToNextStripe();
currentRowGroup = -1;
}
if (!rowGroups.hasNext()) {
currentGroupRowCount = 0;
return false;
}
currentRowGroup++;
RowGroup localCurrentRowGroup = rowGroups.next();
currentGroupRowCount = localCurrentRowGroup.getRowCount();
if (localCurrentRowGroup.getMinAverageRowBytes() > 0) {
maxBatchSize = toIntExact(min(maxBatchSize, max(1, maxBlockBytes / localCurrentRowGroup.getMinAverageRowBytes())));
}
currentPosition = currentStripePosition + localCurrentRowGroup.getRowOffset();
filePosition = stripeFilePositions.get(currentStripe) + localCurrentRowGroup.getRowOffset();
// give reader data streams from row group
InputStreamSources rowGroupStreamSources = localCurrentRowGroup.getStreamSources();
for (AbstractColumnReader columnReader : columnReaders) {
if (columnReader != null) {
if (columnReader instanceof CachingColumnReader || columnReader instanceof ResultCachingSelectiveColumnReader || columnReader instanceof DataCachingSelectiveColumnReader) {
StreamSourceMeta streamSourceMeta = new StreamSourceMeta();
streamSourceMeta.setDataSourceId(orcDataSource.getId());
streamSourceMeta.setLastModifiedTime(orcDataSource.getLastModifiedTime());
streamSourceMeta.setStripeOffset(stripes.get(currentStripe).getOffset());
streamSourceMeta.setRowGroupOffset(localCurrentRowGroup.getRowOffset());
streamSourceMeta.setRowCount(localCurrentRowGroup.getRowCount());
rowGroupStreamSources.setStreamSourceMeta(streamSourceMeta);
}
columnReader.startRowGroup(rowGroupStreamSources);
}
}
return true;
}
Aggregations