Search in sources :

Example 6 with CorrelationTrait

use of org.apache.ignite.internal.sql.engine.trait.CorrelationTrait in project ignite-3 by apache.

the class IgniteFilter method passThroughCorrelation.

/**
 * PassThroughCorrelation.
 * TODO Documentation https://issues.apache.org/jira/browse/IGNITE-15859
 */
@Override
public Pair<RelTraitSet, List<RelTraitSet>> passThroughCorrelation(RelTraitSet nodeTraits, List<RelTraitSet> inTraits) {
    Set<CorrelationId> corrSet = RexUtils.extractCorrelationIds(getCondition());
    CorrelationTrait correlation = TraitUtils.correlation(nodeTraits);
    if (corrSet.isEmpty() || correlation.correlationIds().containsAll(corrSet)) {
        return Pair.of(nodeTraits, List.of(inTraits.get(0).replace(correlation)));
    }
    return null;
}
Also used : CorrelationTrait(org.apache.ignite.internal.sql.engine.trait.CorrelationTrait) CorrelationId(org.apache.calcite.rel.core.CorrelationId)

Aggregations

CorrelationTrait (org.apache.ignite.internal.sql.engine.trait.CorrelationTrait)6 RelOptCluster (org.apache.calcite.plan.RelOptCluster)4 RelTraitSet (org.apache.calcite.plan.RelTraitSet)4 RelNode (org.apache.calcite.rel.RelNode)4 CorrelationId (org.apache.calcite.rel.core.CorrelationId)4 HashSet (java.util.HashSet)2 RexNode (org.apache.calcite.rex.RexNode)2 IgniteCorrelatedNestedLoopJoin (org.apache.ignite.internal.sql.engine.rel.IgniteCorrelatedNestedLoopJoin)2 IgniteFilter (org.apache.ignite.internal.sql.engine.rel.IgniteFilter)2 IgniteTableSpool (org.apache.ignite.internal.sql.engine.rel.IgniteTableSpool)2 ArrayList (java.util.ArrayList)1 RelCollation (org.apache.calcite.rel.RelCollation)1 JoinRelType (org.apache.calcite.rel.core.JoinRelType)1 RexBuilder (org.apache.calcite.rex.RexBuilder)1 RexCorrelVariable (org.apache.calcite.rex.RexCorrelVariable)1 RexInputRef (org.apache.calcite.rex.RexInputRef)1 RexShuttle (org.apache.calcite.rex.RexShuttle)1 RelBuilder (org.apache.calcite.tools.RelBuilder)1 IgniteHashIndexSpool (org.apache.ignite.internal.sql.engine.rel.IgniteHashIndexSpool)1 IgniteSortedIndexSpool (org.apache.ignite.internal.sql.engine.rel.IgniteSortedIndexSpool)1