Search in sources :

Example 1 with BroadcastPartitioningProperty

use of org.apache.hyracks.algebricks.core.algebra.properties.BroadcastPartitioningProperty in project asterixdb by apache.

the class ExternalDataLookupPOperator method getRequiredPropertiesForChildren.

@Override
public PhysicalRequirements getRequiredPropertiesForChildren(ILogicalOperator op, IPhysicalPropertiesVector reqdByParent, IOptimizationContext context) {
    if (requiresBroadcast) {
        StructuralPropertiesVector[] pv = new StructuralPropertiesVector[1];
        pv[0] = new StructuralPropertiesVector(new BroadcastPartitioningProperty(null), null);
        return new PhysicalRequirements(pv, IPartitioningRequirementsCoordinator.NO_COORDINATION);
    } else {
        return super.getRequiredPropertiesForChildren(op, reqdByParent, context);
    }
}
Also used : StructuralPropertiesVector(org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector) BroadcastPartitioningProperty(org.apache.hyracks.algebricks.core.algebra.properties.BroadcastPartitioningProperty) PhysicalRequirements(org.apache.hyracks.algebricks.core.algebra.properties.PhysicalRequirements)

Example 2 with BroadcastPartitioningProperty

use of org.apache.hyracks.algebricks.core.algebra.properties.BroadcastPartitioningProperty in project asterixdb by apache.

the class IndexSearchPOperator method getRequiredPropertiesForChildren.

@Override
public PhysicalRequirements getRequiredPropertiesForChildren(ILogicalOperator op, IPhysicalPropertiesVector reqdByParent, IOptimizationContext context) {
    if (requiresBroadcast) {
        StructuralPropertiesVector[] pv = new StructuralPropertiesVector[1];
        pv[0] = new StructuralPropertiesVector(new BroadcastPartitioningProperty(domain), null);
        return new PhysicalRequirements(pv, IPartitioningRequirementsCoordinator.NO_COORDINATION);
    } else {
        return super.getRequiredPropertiesForChildren(op, reqdByParent, context);
    }
}
Also used : StructuralPropertiesVector(org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector) BroadcastPartitioningProperty(org.apache.hyracks.algebricks.core.algebra.properties.BroadcastPartitioningProperty) PhysicalRequirements(org.apache.hyracks.algebricks.core.algebra.properties.PhysicalRequirements)

Example 3 with BroadcastPartitioningProperty

use of org.apache.hyracks.algebricks.core.algebra.properties.BroadcastPartitioningProperty in project asterixdb by apache.

the class BroadcastExchangePOperator method computeDeliveredProperties.

@Override
public void computeDeliveredProperties(ILogicalOperator op, IOptimizationContext context) {
    IPartitioningProperty pp = new BroadcastPartitioningProperty(domain);
    // Broadcasts will destroy input local properties.
    this.deliveredProperties = new StructuralPropertiesVector(pp, new ArrayList<ILocalStructuralProperty>());
}
Also used : StructuralPropertiesVector(org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector) BroadcastPartitioningProperty(org.apache.hyracks.algebricks.core.algebra.properties.BroadcastPartitioningProperty) ArrayList(java.util.ArrayList) IPartitioningProperty(org.apache.hyracks.algebricks.core.algebra.properties.IPartitioningProperty)

Example 4 with BroadcastPartitioningProperty

use of org.apache.hyracks.algebricks.core.algebra.properties.BroadcastPartitioningProperty 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);
}
Also used : StructuralPropertiesVector(org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector) BroadcastPartitioningProperty(org.apache.hyracks.algebricks.core.algebra.properties.BroadcastPartitioningProperty) ILogicalOperator(org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator) INodeDomain(org.apache.hyracks.algebricks.core.algebra.properties.INodeDomain) PhysicalRequirements(org.apache.hyracks.algebricks.core.algebra.properties.PhysicalRequirements)

Example 5 with BroadcastPartitioningProperty

use of org.apache.hyracks.algebricks.core.algebra.properties.BroadcastPartitioningProperty 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);
}
Also used : StructuralPropertiesVector(org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector) BroadcastPartitioningProperty(org.apache.hyracks.algebricks.core.algebra.properties.BroadcastPartitioningProperty) NotImplementedException(org.apache.hyracks.algebricks.common.exceptions.NotImplementedException) RandomPartitioningProperty(org.apache.hyracks.algebricks.core.algebra.properties.RandomPartitioningProperty) PhysicalRequirements(org.apache.hyracks.algebricks.core.algebra.properties.PhysicalRequirements)

Aggregations

BroadcastPartitioningProperty (org.apache.hyracks.algebricks.core.algebra.properties.BroadcastPartitioningProperty)7 StructuralPropertiesVector (org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector)7 PhysicalRequirements (org.apache.hyracks.algebricks.core.algebra.properties.PhysicalRequirements)6 ArrayList (java.util.ArrayList)2 NotImplementedException (org.apache.hyracks.algebricks.common.exceptions.NotImplementedException)2 ListSet (org.apache.hyracks.algebricks.common.utils.ListSet)2 ILogicalOperator (org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator)2 LogicalVariable (org.apache.hyracks.algebricks.core.algebra.base.LogicalVariable)2 IPartitioningProperty (org.apache.hyracks.algebricks.core.algebra.properties.IPartitioningProperty)2 RandomPartitioningProperty (org.apache.hyracks.algebricks.core.algebra.properties.RandomPartitioningProperty)2 UnorderedPartitionedProperty (org.apache.hyracks.algebricks.core.algebra.properties.UnorderedPartitionedProperty)2 List (java.util.List)1 Map (java.util.Map)1 Set (java.util.Set)1 DataSourceIndex (org.apache.asterix.metadata.declared.DataSourceIndex)1 Index (org.apache.asterix.metadata.entities.Index)1 AlgebricksPartitionConstraint (org.apache.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint)1 AlgebricksException (org.apache.hyracks.algebricks.common.exceptions.AlgebricksException)1 Pair (org.apache.hyracks.algebricks.common.utils.Pair)1 EquivalenceClass (org.apache.hyracks.algebricks.core.algebra.base.EquivalenceClass)1