use of org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector in project asterixdb by apache.
the class NestedLoopJoinPOperator method getRequiredPropertiesForChildren.
@Override
public PhysicalRequirements getRequiredPropertiesForChildren(ILogicalOperator op, IPhysicalPropertiesVector reqdByParent, IOptimizationContext context) {
if (partitioningType != JoinPartitioningType.BROADCAST) {
throw new NotImplementedException(partitioningType + " nested loop joins are not implemented.");
}
StructuralPropertiesVector[] pv = new StructuralPropertiesVector[2];
// TODO: leverage statistics to make better decisions.
pv[0] = OperatorPropertiesUtil.checkUnpartitionedAndGetPropertiesVector(op, new StructuralPropertiesVector(new RandomPartitioningProperty(context.getComputationNodeDomain()), null));
pv[1] = OperatorPropertiesUtil.checkUnpartitionedAndGetPropertiesVector(op, new StructuralPropertiesVector(new BroadcastPartitioningProperty(context.getComputationNodeDomain()), null));
return new PhysicalRequirements(pv, IPartitioningRequirementsCoordinator.NO_COORDINATION);
}
use of org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector in project asterixdb by apache.
the class AggregatePOperator method getRequiredPropertiesForChildren.
@Override
public PhysicalRequirements getRequiredPropertiesForChildren(ILogicalOperator op, IPhysicalPropertiesVector reqdByParent, IOptimizationContext context) {
AggregateOperator aggOp = (AggregateOperator) op;
StructuralPropertiesVector[] pv = new StructuralPropertiesVector[1];
if (aggOp.isGlobal() && aggOp.getExecutionMode() == AbstractLogicalOperator.ExecutionMode.UNPARTITIONED) {
pv[0] = new StructuralPropertiesVector(IPartitioningProperty.UNPARTITIONED, null);
return new PhysicalRequirements(pv, IPartitioningRequirementsCoordinator.NO_COORDINATION);
} else {
return emptyUnaryRequirements();
}
}
use of org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector in project asterixdb by apache.
the class IntersectPOperator method getRequiredPropertiesForChildren.
@Override
public PhysicalRequirements getRequiredPropertiesForChildren(ILogicalOperator iop, IPhysicalPropertiesVector reqdByParent, IOptimizationContext context) {
IntersectOperator intersectOp = (IntersectOperator) iop;
StructuralPropertiesVector[] pv = new StructuralPropertiesVector[intersectOp.getNumInput()];
for (int i = 0; i < intersectOp.getNumInput(); i++) {
List<ILocalStructuralProperty> localProps = new ArrayList<>();
List<OrderColumn> orderColumns = new ArrayList<>();
for (LogicalVariable column : intersectOp.getInputVariables(i)) {
orderColumns.add(new OrderColumn(column, OrderOperator.IOrder.OrderKind.ASC));
}
localProps.add(new LocalOrderProperty(orderColumns));
IPartitioningProperty pp = null;
if (intersectOp.getExecutionMode() == AbstractLogicalOperator.ExecutionMode.PARTITIONED) {
Set<LogicalVariable> partitioningVariables = new HashSet<>(intersectOp.getInputVariables(i));
pp = new UnorderedPartitionedProperty(partitioningVariables, null);
}
pv[i] = new StructuralPropertiesVector(pp, localProps);
}
return new PhysicalRequirements(pv, IPartitioningRequirementsCoordinator.NO_COORDINATION);
}
use of org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector in project asterixdb by apache.
the class DistributeResultPOperator method getRequiredPropertiesForChildren.
@Override
public PhysicalRequirements getRequiredPropertiesForChildren(ILogicalOperator op, IPhysicalPropertiesVector reqdByParent, IOptimizationContext context) {
DistributeResultOperator write = (DistributeResultOperator) op;
IDataSink sink = write.getDataSink();
IPartitioningProperty pp = sink.getPartitioningProperty();
StructuralPropertiesVector[] r = new StructuralPropertiesVector[] { new StructuralPropertiesVector(pp, null) };
return new PhysicalRequirements(r, IPartitioningRequirementsCoordinator.NO_COORDINATION);
}
use of org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector in project asterixdb by apache.
the class ExternalGroupByPOperator method getRequiredPropertiesForChildren.
@Override
public PhysicalRequirements getRequiredPropertiesForChildren(ILogicalOperator op, IPhysicalPropertiesVector reqdByParent, IOptimizationContext context) {
AbstractLogicalOperator aop = (AbstractLogicalOperator) op;
if (aop.getExecutionMode() == ExecutionMode.PARTITIONED) {
StructuralPropertiesVector[] pv = new StructuralPropertiesVector[1];
pv[0] = new StructuralPropertiesVector(new UnorderedPartitionedProperty(new ListSet<LogicalVariable>(columnSet), context.getComputationNodeDomain()), null);
return new PhysicalRequirements(pv, IPartitioningRequirementsCoordinator.NO_COORDINATION);
} else {
return emptyUnaryRequirements();
}
}
Aggregations