use of org.apache.hyracks.algebricks.core.algebra.properties.PhysicalRequirements in project asterixdb by apache.
the class DataSourceScanPOperator method getRequiredPropertiesForChildren.
@Override
public PhysicalRequirements getRequiredPropertiesForChildren(ILogicalOperator op, IPhysicalPropertiesVector reqdByParent, IOptimizationContext context) {
if (op.getInputs().isEmpty()) {
return emptyUnaryRequirements();
}
ILogicalOperator childOp = op.getInputs().get(0).getValue();
// Empty tuple source is a special case that can be partitioned in the same way as the data scan.
if (childOp.getOperatorTag() == LogicalOperatorTag.EMPTYTUPLESOURCE) {
return emptyUnaryRequirements();
}
INodeDomain domain = dataSource.getDomain();
return new PhysicalRequirements(new StructuralPropertiesVector[] { new StructuralPropertiesVector(new BroadcastPartitioningProperty(domain), null) }, IPartitioningRequirementsCoordinator.NO_COORDINATION);
}
use of org.apache.hyracks.algebricks.core.algebra.properties.PhysicalRequirements 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.PhysicalRequirements 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.PhysicalRequirements in project asterixdb by apache.
the class InsertDeleteUpsertPOperator method getRequiredPropertiesForChildren.
@Override
public PhysicalRequirements getRequiredPropertiesForChildren(ILogicalOperator op, IPhysicalPropertiesVector reqdByParent, IOptimizationContext context) {
List<LogicalVariable> scanVariables = new ArrayList<LogicalVariable>();
scanVariables.addAll(keys);
scanVariables.add(payload);
if (additionalNonFilteringFields != null) {
scanVariables.addAll(additionalNonFilteringFields);
}
IPhysicalPropertiesVector r = dataSource.getPropertiesProvider().computePropertiesVector(scanVariables);
r.getLocalProperties().clear();
IPhysicalPropertiesVector[] requirements = new IPhysicalPropertiesVector[1];
requirements[0] = r;
return new PhysicalRequirements(requirements, IPartitioningRequirementsCoordinator.NO_COORDINATION);
}
use of org.apache.hyracks.algebricks.core.algebra.properties.PhysicalRequirements 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);
}
Aggregations