Function<RecordSet, RecordSet> keyFormatter = new Function<RecordSet, RecordSet>()
{
@Override
public RecordSet apply(RecordSet key)
{
return new MappedRecordSet(new AppendingRecordSet(key, rawFixedValues, rawFixedTypes), keyRemap);
}
};
// Compute how to map from the output of the indexed data to the expected output schema
final List<Integer> outputRemap = computeRemap(table.getOutputColumns(), handleToNames(outputSchema));
Function<RecordSet, RecordSet> outputFormatter = new Function<RecordSet, RecordSet>()
{
@Override
public RecordSet apply(RecordSet output)
{
return new MappedRecordSet(output, outputRemap);
}
};
return new TpchIndex(keyFormatter, outputFormatter, table);
}