use of org.apache.hyracks.algebricks.core.algebra.operators.logical.IntersectOperator in project asterixdb by apache.
the class IntersectPOperator method computeDeliveredProperties.
@Override
public void computeDeliveredProperties(ILogicalOperator iop, IOptimizationContext context) throws AlgebricksException {
IntersectOperator op = (IntersectOperator) iop;
IPartitioningProperty pp = op.getInputs().get(0).getValue().getDeliveredPhysicalProperties().getPartitioningProperty();
HashMap<LogicalVariable, LogicalVariable> varMaps = new HashMap<>(op.getOutputVars().size());
for (int i = 0; i < op.getOutputVars().size(); i++) {
varMaps.put(op.getInputVariables(0).get(i), op.getOutputVars().get(i));
}
pp.substituteColumnVars(varMaps);
List<ILocalStructuralProperty> propsLocal = new ArrayList<>();
List<OrderColumn> orderColumns = new ArrayList<>();
for (LogicalVariable var : op.getOutputVars()) {
orderColumns.add(new OrderColumn(var, OrderOperator.IOrder.OrderKind.ASC));
}
propsLocal.add(new LocalOrderProperty(orderColumns));
deliveredProperties = new StructuralPropertiesVector(pp, propsLocal);
}
use of org.apache.hyracks.algebricks.core.algebra.operators.logical.IntersectOperator in project asterixdb by apache.
the class IsomorphismVariableMappingVisitor method mapVariablesForIntersect.
private void mapVariablesForIntersect(IntersectOperator op, ILogicalOperator arg) {
if (op.getOperatorTag() != arg.getOperatorTag()) {
return;
}
IntersectOperator opArg = (IntersectOperator) arg;
if (op.getNumInput() != opArg.getNumInput()) {
return;
}
for (int i = 0; i < op.getNumInput(); i++) {
for (int j = 0; j < op.getInputVariables(i).size(); j++) {
if (!varEquivalent(op.getInputVariables(i).get(j), opArg.getInputVariables(i).get(j))) {
return;
}
}
}
mapVariables(op.getOutputVars(), opArg.getOutputVars());
}
Aggregations