Search in sources :

Example 1 with IndexedTable

use of io.trino.testing.tpch.TpchIndexedData.IndexedTable in project trino by trinodb.

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(format("No such index: %s%s", splitInfo.getTableName(), splitInfo.getLookupColumnNames())));
    List<Type> lookupColumnTypes = types(splitInfo.getTableName(), splitInfo.getLookupColumnNames());
    RecordSet keyRecordSet = new ListBasedRecordSet(splitInfo.getKeys(), lookupColumnTypes);
    RecordSet outputRecordSet = lookupIndexKeys(keyRecordSet, indexedTable, outputColumnNames, splitInfo.getLookupColumnNames());
    return new RecordPageSource(outputRecordSet);
}
Also used : Type(io.trino.spi.type.Type) RecordSet(io.trino.spi.connector.RecordSet) MappedRecordSet(io.trino.split.MappedRecordSet) IndexedTable(io.trino.testing.tpch.TpchIndexedData.IndexedTable) RecordPageSource(io.trino.spi.connector.RecordPageSource)

Aggregations

RecordPageSource (io.trino.spi.connector.RecordPageSource)1 RecordSet (io.trino.spi.connector.RecordSet)1 Type (io.trino.spi.type.Type)1 MappedRecordSet (io.trino.split.MappedRecordSet)1 IndexedTable (io.trino.testing.tpch.TpchIndexedData.IndexedTable)1