Search in sources :

Example 1 with ColumnDriftRawResultIterator

use of org.apache.carbondata.core.scan.result.iterator.ColumnDriftRawResultIterator in project carbondata by apache.

the class CarbonCompactionExecutor method getRawResultIterator.

private RawResultIterator getRawResultIterator(Configuration configuration, String segmentId, String task, List<TableBlockInfo> tableBlockInfoList) throws IOException {
    SegmentProperties sourceSegmentProperties = new SegmentProperties(tableBlockInfoList.get(0).getDataFileFooter().getColumnInTable());
    boolean hasColumnDrift = carbonTable.hasColumnDrift() && RestructureUtil.hasColumnDriftOnSegment(carbonTable, sourceSegmentProperties);
    if (hasColumnDrift) {
        return new ColumnDriftRawResultIterator(executeBlockList(tableBlockInfoList, segmentId, task, configuration), sourceSegmentProperties, destinationSegProperties);
    } else {
        if (restructuredBlockExists) {
            sourceSegmentProperties = getSourceSegmentProperties(Collections.singletonList(tableBlockInfoList.get(0).getDataFileFooter()));
        }
        return new RawResultIterator(executeBlockList(tableBlockInfoList, segmentId, task, configuration), sourceSegmentProperties, destinationSegProperties, true);
    }
}
Also used : RawResultIterator(org.apache.carbondata.core.scan.result.iterator.RawResultIterator) ColumnDriftRawResultIterator(org.apache.carbondata.core.scan.result.iterator.ColumnDriftRawResultIterator) ColumnDriftRawResultIterator(org.apache.carbondata.core.scan.result.iterator.ColumnDriftRawResultIterator) SegmentProperties(org.apache.carbondata.core.datastore.block.SegmentProperties)

Aggregations

SegmentProperties (org.apache.carbondata.core.datastore.block.SegmentProperties)1 ColumnDriftRawResultIterator (org.apache.carbondata.core.scan.result.iterator.ColumnDriftRawResultIterator)1 RawResultIterator (org.apache.carbondata.core.scan.result.iterator.RawResultIterator)1