Search in sources :

Example 6 with IndexLookupBatch

use of org.h2.index.IndexLookupBatch in project ignite by apache.

the class H2TreeIndex method createLookupBatch.

/**
 * {@inheritDoc}
 */
@Override
public IndexLookupBatch createLookupBatch(TableFilter[] filters, int filter) {
    QueryContext qctx = H2Utils.context(filters[filter].getSession());
    if (qctx == null || qctx.distributedJoinContext() == null || !getTable().isPartitioned())
        return null;
    IndexColumn affCol = getTable().getAffinityKeyColumn();
    GridH2RowDescriptor desc = getTable().rowDescriptor();
    int affColId = -1;
    boolean ucast = false;
    if (affCol != null) {
        affColId = affCol.column.getColumnId();
        int[] masks = filters[filter].getMasks();
        if (masks != null) {
            ucast = (masks[affColId] & IndexCondition.EQUALITY) != 0 || desc.checkKeyIndexCondition(masks, IndexCondition.EQUALITY);
        }
    }
    return new DistributedLookupBatch(this, cctx, ucast, affColId);
}
Also used : DistributedLookupBatch(org.apache.ignite.internal.processors.query.h2.opt.join.DistributedLookupBatch) GridH2RowDescriptor(org.apache.ignite.internal.processors.query.h2.opt.GridH2RowDescriptor) IndexQueryContext(org.apache.ignite.internal.cache.query.index.sorted.inline.IndexQueryContext) QueryContext(org.apache.ignite.internal.processors.query.h2.opt.QueryContext) IndexColumn(org.h2.table.IndexColumn)

Aggregations

IndexLookupBatch (org.h2.index.IndexLookupBatch)3 IndexColumn (org.h2.table.IndexColumn)2 IndexQueryContext (org.apache.ignite.internal.cache.query.index.sorted.inline.IndexQueryContext)1 GridH2RowDescriptor (org.apache.ignite.internal.processors.query.h2.opt.GridH2RowDescriptor)1 QueryContext (org.apache.ignite.internal.processors.query.h2.opt.QueryContext)1 DistributedLookupBatch (org.apache.ignite.internal.processors.query.h2.opt.join.DistributedLookupBatch)1 ProxyDistributedLookupBatch (org.apache.ignite.internal.processors.query.h2.opt.join.ProxyDistributedLookupBatch)1 Query (org.h2.command.dml.Query)1 Select (org.h2.command.dml.Select)1 IndexCondition (org.h2.index.IndexCondition)1 StatementBuilder (org.h2.util.StatementBuilder)1