use of org.apache.ignite.internal.sql.engine.trait.RewindabilityTrait in project ignite-3 by apache.
the class IgniteCorrelatedNestedLoopJoin method passThroughRewindability.
/**
* {@inheritDoc}
*/
@Override
public Pair<RelTraitSet, List<RelTraitSet>> passThroughRewindability(RelTraitSet nodeTraits, List<RelTraitSet> inputTraits) {
// Correlated nested loop requires rewindable right edge.
RelTraitSet left = inputTraits.get(0);
RelTraitSet right = inputTraits.get(1);
RewindabilityTrait rewindability = TraitUtils.rewindability(nodeTraits);
return Pair.of(nodeTraits.replace(rewindability), List.of(left.replace(rewindability), right.replace(RewindabilityTrait.REWINDABLE)));
}
use of org.apache.ignite.internal.sql.engine.trait.RewindabilityTrait in project ignite-3 by apache.
the class IgniteProject method deriveRewindability.
/**
* {@inheritDoc}
*/
@Override
public List<Pair<RelTraitSet, List<RelTraitSet>>> deriveRewindability(RelTraitSet nodeTraits, List<RelTraitSet> inputTraits) {
// The node is rewindable if its input is rewindable.
RelTraitSet in = inputTraits.get(0);
RewindabilityTrait rewindability = TraitUtils.rewindability(in);
return List.of(Pair.of(nodeTraits.replace(rewindability), List.of(in)));
}
use of org.apache.ignite.internal.sql.engine.trait.RewindabilityTrait in project ignite-3 by apache.
the class AbstractIgniteJoin method deriveRewindability.
/**
* {@inheritDoc}
*/
@Override
public List<Pair<RelTraitSet, List<RelTraitSet>>> deriveRewindability(RelTraitSet nodeTraits, List<RelTraitSet> inputTraits) {
// The node is rewindable only if both sources are rewindable.
RelTraitSet left = inputTraits.get(0);
RelTraitSet right = inputTraits.get(1);
RewindabilityTrait leftRewindability = TraitUtils.rewindability(left);
RewindabilityTrait rightRewindability = TraitUtils.rewindability(right);
List<Pair<RelTraitSet, List<RelTraitSet>>> pairs = new ArrayList<>();
pairs.add(Pair.of(nodeTraits.replace(RewindabilityTrait.ONE_WAY), List.of(left.replace(RewindabilityTrait.ONE_WAY), right.replace(RewindabilityTrait.ONE_WAY))));
if (leftRewindability.rewindable() && rightRewindability.rewindable()) {
pairs.add(Pair.of(nodeTraits.replace(RewindabilityTrait.REWINDABLE), List.of(left.replace(RewindabilityTrait.REWINDABLE), right.replace(RewindabilityTrait.REWINDABLE))));
}
return List.copyOf(pairs);
}
use of org.apache.ignite.internal.sql.engine.trait.RewindabilityTrait in project ignite-3 by apache.
the class IgniteCorrelatedNestedLoopJoin method deriveRewindability.
/**
* {@inheritDoc}
*/
@Override
public List<Pair<RelTraitSet, List<RelTraitSet>>> deriveRewindability(RelTraitSet nodeTraits, List<RelTraitSet> inputTraits) {
// Correlated nested loop requires rewindable right edge.
RelTraitSet left = inputTraits.get(0);
RelTraitSet right = inputTraits.get(1);
RewindabilityTrait rewindability = TraitUtils.rewindability(left);
return List.of(Pair.of(nodeTraits.replace(rewindability), List.of(left, right.replace(RewindabilityTrait.REWINDABLE))));
}
Aggregations