use of org.apache.ignite.internal.sql.engine.metadata.ColocationGroup in project ignite-3 by apache.
the class LogicalRelImplementor method visit.
/**
* {@inheritDoc}
*/
@Override
public Node<RowT> visit(IgniteTableScan rel) {
RexNode condition = rel.condition();
List<RexNode> projects = rel.projects();
ImmutableBitSet requiredColumns = rel.requiredColumns();
InternalIgniteTable tbl = rel.getTable().unwrap(InternalIgniteTable.class);
assert tbl != null;
IgniteTypeFactory typeFactory = ctx.getTypeFactory();
RelDataType rowType = tbl.getRowType(typeFactory, requiredColumns);
Predicate<RowT> filters = condition == null ? null : expressionFactory.predicate(condition, rowType);
Function<RowT, RowT> prj = projects == null ? null : expressionFactory.project(projects, rowType);
ColocationGroup group = ctx.group(rel.sourceId());
if (!group.nodeIds().contains(ctx.localNodeId())) {
return new ScanNode<>(ctx, rowType, Collections.emptyList());
}
return new TableScanNode<>(ctx, rowType, tbl, group.partitions(ctx.localNodeId()), filters, prj, requiredColumns);
}
Aggregations