use of org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector in project asterixdb by apache.
the class SortGroupByPOperator method computeDeliveredProperties.
@Override
public void computeDeliveredProperties(ILogicalOperator op, IOptimizationContext context) {
List<ILocalStructuralProperty> propsLocal = new LinkedList<ILocalStructuralProperty>();
GroupByOperator gOp = (GroupByOperator) op;
Set<LogicalVariable> columnSet = new ListSet<LogicalVariable>();
List<OrderColumn> ocs = new ArrayList<OrderColumn>();
if (!columnSet.isEmpty()) {
propsLocal.add(new LocalGroupingProperty(columnSet));
}
for (OrderColumn oc : orderColumns) {
ocs.add(oc);
}
propsLocal.add(new LocalOrderProperty(ocs));
for (ILogicalPlan p : gOp.getNestedPlans()) {
for (Mutable<ILogicalOperator> r : p.getRoots()) {
ILogicalOperator rOp = r.getValue();
propsLocal.addAll(rOp.getDeliveredPhysicalProperties().getLocalProperties());
}
}
ILogicalOperator op2 = op.getInputs().get(0).getValue();
IPhysicalPropertiesVector childProp = op2.getDeliveredPhysicalProperties();
deliveredProperties = new StructuralPropertiesVector(childProp.getPartitioningProperty(), propsLocal);
}
use of org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector in project asterixdb by apache.
the class StreamLimitPOperator method getRequiredPropertiesForChildren.
@Override
public PhysicalRequirements getRequiredPropertiesForChildren(ILogicalOperator op, IPhysicalPropertiesVector reqdByParent, IOptimizationContext context) {
AbstractLogicalOperator limitOp = (AbstractLogicalOperator) op;
if (limitOp.getExecutionMode() == AbstractLogicalOperator.ExecutionMode.UNPARTITIONED) {
StructuralPropertiesVector[] pv = new StructuralPropertiesVector[1];
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 SortMergeExchangePOperator method getRequiredPropertiesForChildren.
@Override
public PhysicalRequirements getRequiredPropertiesForChildren(ILogicalOperator op, IPhysicalPropertiesVector reqdByParent, IOptimizationContext context) {
List<ILocalStructuralProperty> localProps = new ArrayList<ILocalStructuralProperty>(sortColumns.length);
localProps.add(new LocalOrderProperty(Arrays.asList(sortColumns)));
StructuralPropertiesVector[] r = new StructuralPropertiesVector[] { new StructuralPropertiesVector(null, localProps) };
return new PhysicalRequirements(r, IPartitioningRequirementsCoordinator.NO_COORDINATION);
}
use of org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector in project asterixdb by apache.
the class SubplanPOperator method computeDeliveredProperties.
@Override
public void computeDeliveredProperties(ILogicalOperator op, IOptimizationContext context) {
AbstractLogicalOperator op2 = (AbstractLogicalOperator) op.getInputs().get(0).getValue();
IPhysicalPropertiesVector childsProperties = op2.getPhysicalOperator().getDeliveredProperties();
List<ILocalStructuralProperty> propsLocal = new ArrayList<>();
if (childsProperties.getLocalProperties() != null) {
propsLocal.addAll(childsProperties.getLocalProperties());
}
// ... get local properties for newly created variables...
SubplanOperator subplan = (SubplanOperator) op;
for (ILogicalPlan plan : subplan.getNestedPlans()) {
for (Mutable<ILogicalOperator> r : plan.getRoots()) {
AbstractLogicalOperator rOp = (AbstractLogicalOperator) r.getValue();
propsLocal.addAll(rOp.getPhysicalOperator().getDeliveredProperties().getLocalProperties());
}
}
deliveredProperties = new StructuralPropertiesVector(childsProperties.getPartitioningProperty(), propsLocal);
}
use of org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector in project asterixdb by apache.
the class StreamLimitPOperator method computeDeliveredProperties.
@Override
public void computeDeliveredProperties(ILogicalOperator op, IOptimizationContext context) {
AbstractLogicalOperator limitOp = (AbstractLogicalOperator) op;
ILogicalOperator op2 = op.getInputs().get(0).getValue();
if (limitOp.getExecutionMode() == AbstractLogicalOperator.ExecutionMode.UNPARTITIONED) {
//partitioning property: unpartitioned; local property: whatever from the child
deliveredProperties = new StructuralPropertiesVector(IPartitioningProperty.UNPARTITIONED, op2.getDeliveredPhysicalProperties().getLocalProperties());
} else {
deliveredProperties = op2.getDeliveredPhysicalProperties().clone();
}
}
Aggregations