Search in sources :

Example 26 with StructuralPropertiesVector

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);
}
Also used : LogicalVariable(org.apache.hyracks.algebricks.core.algebra.base.LogicalVariable) StructuralPropertiesVector(org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector) GroupByOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.GroupByOperator) OrderColumn(org.apache.hyracks.algebricks.core.algebra.properties.OrderColumn) LocalGroupingProperty(org.apache.hyracks.algebricks.core.algebra.properties.LocalGroupingProperty) ILogicalOperator(org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator) ArrayList(java.util.ArrayList) IPhysicalPropertiesVector(org.apache.hyracks.algebricks.core.algebra.properties.IPhysicalPropertiesVector) LinkedList(java.util.LinkedList) ListSet(org.apache.hyracks.algebricks.common.utils.ListSet) LocalOrderProperty(org.apache.hyracks.algebricks.core.algebra.properties.LocalOrderProperty) ILogicalPlan(org.apache.hyracks.algebricks.core.algebra.base.ILogicalPlan) ILocalStructuralProperty(org.apache.hyracks.algebricks.core.algebra.properties.ILocalStructuralProperty)

Example 27 with StructuralPropertiesVector

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();
    }
}
Also used : StructuralPropertiesVector(org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector) AbstractLogicalOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator) PhysicalRequirements(org.apache.hyracks.algebricks.core.algebra.properties.PhysicalRequirements)

Example 28 with StructuralPropertiesVector

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);
}
Also used : StructuralPropertiesVector(org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector) LocalOrderProperty(org.apache.hyracks.algebricks.core.algebra.properties.LocalOrderProperty) ArrayList(java.util.ArrayList) ILocalStructuralProperty(org.apache.hyracks.algebricks.core.algebra.properties.ILocalStructuralProperty) PhysicalRequirements(org.apache.hyracks.algebricks.core.algebra.properties.PhysicalRequirements)

Example 29 with StructuralPropertiesVector

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);
}
Also used : StructuralPropertiesVector(org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector) SubplanOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.SubplanOperator) AbstractLogicalOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator) ILogicalOperator(org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator) ArrayList(java.util.ArrayList) ILogicalPlan(org.apache.hyracks.algebricks.core.algebra.base.ILogicalPlan) IPhysicalPropertiesVector(org.apache.hyracks.algebricks.core.algebra.properties.IPhysicalPropertiesVector) ILocalStructuralProperty(org.apache.hyracks.algebricks.core.algebra.properties.ILocalStructuralProperty)

Example 30 with StructuralPropertiesVector

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();
    }
}
Also used : StructuralPropertiesVector(org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector) AbstractLogicalOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator) ILogicalOperator(org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator)

Aggregations

StructuralPropertiesVector (org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector)45 ArrayList (java.util.ArrayList)22 ILocalStructuralProperty (org.apache.hyracks.algebricks.core.algebra.properties.ILocalStructuralProperty)22 PhysicalRequirements (org.apache.hyracks.algebricks.core.algebra.properties.PhysicalRequirements)21 IPartitioningProperty (org.apache.hyracks.algebricks.core.algebra.properties.IPartitioningProperty)20 AbstractLogicalOperator (org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator)19 LogicalVariable (org.apache.hyracks.algebricks.core.algebra.base.LogicalVariable)18 IPhysicalPropertiesVector (org.apache.hyracks.algebricks.core.algebra.properties.IPhysicalPropertiesVector)13 LocalOrderProperty (org.apache.hyracks.algebricks.core.algebra.properties.LocalOrderProperty)12 OrderColumn (org.apache.hyracks.algebricks.core.algebra.properties.OrderColumn)12 ILogicalOperator (org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator)11 UnorderedPartitionedProperty (org.apache.hyracks.algebricks.core.algebra.properties.UnorderedPartitionedProperty)9 ListSet (org.apache.hyracks.algebricks.common.utils.ListSet)7 BroadcastPartitioningProperty (org.apache.hyracks.algebricks.core.algebra.properties.BroadcastPartitioningProperty)7 LinkedList (java.util.LinkedList)6 RandomPartitioningProperty (org.apache.hyracks.algebricks.core.algebra.properties.RandomPartitioningProperty)6 ILogicalPlan (org.apache.hyracks.algebricks.core.algebra.base.ILogicalPlan)5 GroupByOperator (org.apache.hyracks.algebricks.core.algebra.operators.logical.GroupByOperator)5 HashMap (java.util.HashMap)3 NotImplementedException (org.apache.hyracks.algebricks.common.exceptions.NotImplementedException)3