@Override public RecordReader<Void, T> createRecordReader(InputSplit inputSplit, TaskAttemptContext taskAttemptContext) throws IOException, InterruptedException { Configuration configuration = taskAttemptContext.getConfiguration(); QueryModel queryModel = createQueryModel(inputSplit, taskAttemptContext); CarbonReadSupport<T> readSupport = getReadSupportClass(configuration); return new CarbonRecordReader<T>(queryModel, readSupport, taskAttemptContext.getConfiguration()); }
new CarbonRecordReader<>(queryModel, new CarbonRowReadSupport(), new Configuration()); reader.initialize(mbSplit, null); while (reader.nextKeyValue() && rowCount < limit) { rows.add(reader.getCurrentValue()); rowCount++; throw new IOException(e); } finally { reader.close();
validateReader(); if (currentReader instanceof CarbonRecordReader) { List<Object> batchValue = ((CarbonRecordReader) currentReader).getBatchValue(); if (batchValue == null) { return null;
@Override public void close() throws IOException { logStatistics(rowCount, queryModel.getStatisticsRecorder()); // clear dictionary cache Map<String, Dictionary> columnToDictionaryMapping = queryModel.getColumnToDictionaryMapping(); if (null != columnToDictionaryMapping) { for (Map.Entry<String, Dictionary> entry : columnToDictionaryMapping.entrySet()) { CarbonUtil.clearDictionaryCache(entry.getValue()); } } if (!skipClearDataMapAtClose) { // Clear the datamap cache DataMapStoreManager.getInstance().clearDataMaps( queryModel.getTable().getAbsoluteTableIdentifier()); } // close read support readSupport.close(); carbonIterator.close(); try { queryExecutor.finish(); } catch (QueryExecutionException e) { throw new IOException(e); } }