Search in sources :

Example 1 with IndexedTable

use of com.facebook.presto.tests.tpch.TpchIndexedData.IndexedTable in project presto by prestodb.

the class ThriftIndexedTpchService method createLookupPageSource.

@Override
protected ConnectorPageSource createLookupPageSource(SplitInfo splitInfo, List<String> outputColumnNames) {
    IndexedTable indexedTable = indexedData.getIndexedTable(splitInfo.getTableName(), schemaNameToScaleFactor(splitInfo.getSchemaName()), ImmutableSet.copyOf(splitInfo.getLookupColumnNames())).orElseThrow(() -> new IllegalArgumentException(String.format("No such index: %s%s", splitInfo.getTableName(), splitInfo.getLookupColumnNames())));
    List<Type> lookupColumnTypes = types(splitInfo.getTableName(), splitInfo.getLookupColumnNames());
    RecordSet keyRecordSet = new MappedRecordSet(new ListBasedRecordSet(splitInfo.getKeys(), lookupColumnTypes), computeRemap(splitInfo.getLookupColumnNames(), indexedTable.getKeyColumns()));
    RecordSet outputRecordSet = lookupIndexKeys(keyRecordSet, indexedTable, outputColumnNames);
    return new RecordPageSource(outputRecordSet);
}
Also used : Type(com.facebook.presto.common.type.Type) MappedRecordSet(com.facebook.presto.split.MappedRecordSet) RecordSet(com.facebook.presto.spi.RecordSet) MappedRecordSet(com.facebook.presto.split.MappedRecordSet) IndexedTable(com.facebook.presto.tests.tpch.TpchIndexedData.IndexedTable) RecordPageSource(com.facebook.presto.spi.RecordPageSource)

Aggregations

Type (com.facebook.presto.common.type.Type)1 RecordPageSource (com.facebook.presto.spi.RecordPageSource)1 RecordSet (com.facebook.presto.spi.RecordSet)1 MappedRecordSet (com.facebook.presto.split.MappedRecordSet)1 IndexedTable (com.facebook.presto.tests.tpch.TpchIndexedData.IndexedTable)1