Search in sources :

Example 1 with SplitOperatorInfo

use of io.trino.operator.SplitOperatorInfo in project trino by trinodb.

the class IndexSourceOperator method addSplit.

@Override
public Supplier<Optional<UpdatablePageSource>> addSplit(Split split) {
    requireNonNull(split, "split is null");
    checkState(source == null, "Index source split already set");
    IndexSplit indexSplit = (IndexSplit) split.getConnectorSplit();
    // Normalize the incoming RecordSet to something that can be consumed by the index
    RecordSet normalizedRecordSet = probeKeyNormalizer.apply(indexSplit.getKeyRecordSet());
    ConnectorPageSource result = index.lookup(normalizedRecordSet);
    source = new PageSourceOperator(result, operatorContext);
    Object splitInfo = split.getInfo();
    if (splitInfo != null) {
        operatorContext.setInfoSupplier(Suppliers.ofInstance(new SplitOperatorInfo(split.getCatalogName(), splitInfo)));
    }
    return Optional::empty;
}
Also used : SplitOperatorInfo(io.trino.operator.SplitOperatorInfo) RecordSet(io.trino.spi.connector.RecordSet) ConnectorPageSource(io.trino.spi.connector.ConnectorPageSource) PageSourceOperator(io.trino.operator.PageSourceOperator)

Aggregations

PageSourceOperator (io.trino.operator.PageSourceOperator)1 SplitOperatorInfo (io.trino.operator.SplitOperatorInfo)1 ConnectorPageSource (io.trino.spi.connector.ConnectorPageSource)1 RecordSet (io.trino.spi.connector.RecordSet)1