Search in sources :

Example 1 with FDsAndEquivClassesVisitor

use of org.apache.hyracks.algebricks.core.algebra.operators.logical.visitors.FDsAndEquivClassesVisitor in project asterixdb by apache.

the class EnforceStructuralPropertiesRule method newPropertiesDiff.

private IPhysicalPropertiesVector newPropertiesDiff(AbstractLogicalOperator newChild, IPhysicalPropertiesVector required, boolean mayExpandPartitioningProperties, IOptimizationContext context) throws AlgebricksException {
    IPhysicalPropertiesVector newDelivered = newChild.getDeliveredPhysicalProperties();
    Map<LogicalVariable, EquivalenceClass> newChildEqClasses = context.getEquivalenceClassMap(newChild);
    List<FunctionalDependency> newChildFDs = context.getFDList(newChild);
    if (newChildEqClasses == null || newChildFDs == null) {
        FDsAndEquivClassesVisitor fdsVisitor = new FDsAndEquivClassesVisitor();
        newChild.accept(fdsVisitor, context);
        newChildEqClasses = context.getEquivalenceClassMap(newChild);
        newChildFDs = context.getFDList(newChild);
    }
    AlgebricksConfig.ALGEBRICKS_LOGGER.finest(">>>> Required properties for new op. " + newChild.getPhysicalOperator() + ": " + required + "\n");
    return newDelivered.getUnsatisfiedPropertiesFrom(required, mayExpandPartitioningProperties, newChildEqClasses, newChildFDs);
}
Also used : LogicalVariable(org.apache.hyracks.algebricks.core.algebra.base.LogicalVariable) FunctionalDependency(org.apache.hyracks.algebricks.core.algebra.properties.FunctionalDependency) FDsAndEquivClassesVisitor(org.apache.hyracks.algebricks.core.algebra.operators.logical.visitors.FDsAndEquivClassesVisitor) IPhysicalPropertiesVector(org.apache.hyracks.algebricks.core.algebra.properties.IPhysicalPropertiesVector) EquivalenceClass(org.apache.hyracks.algebricks.core.algebra.base.EquivalenceClass)

Example 2 with FDsAndEquivClassesVisitor

use of org.apache.hyracks.algebricks.core.algebra.operators.logical.visitors.FDsAndEquivClassesVisitor in project asterixdb by apache.

the class PhysicalOptimizationsUtil method computeFDsAndEquivalenceClasses.

public static void computeFDsAndEquivalenceClasses(ILogicalOperator op, IOptimizationContext ctx) throws AlgebricksException {
    FDsAndEquivClassesVisitor visitor = new FDsAndEquivClassesVisitor();
    visitOperatorAndItsDescendants(op, visitor, ctx);
}
Also used : FDsAndEquivClassesVisitor(org.apache.hyracks.algebricks.core.algebra.operators.logical.visitors.FDsAndEquivClassesVisitor)

Aggregations

FDsAndEquivClassesVisitor (org.apache.hyracks.algebricks.core.algebra.operators.logical.visitors.FDsAndEquivClassesVisitor)2 EquivalenceClass (org.apache.hyracks.algebricks.core.algebra.base.EquivalenceClass)1 LogicalVariable (org.apache.hyracks.algebricks.core.algebra.base.LogicalVariable)1 FunctionalDependency (org.apache.hyracks.algebricks.core.algebra.properties.FunctionalDependency)1 IPhysicalPropertiesVector (org.apache.hyracks.algebricks.core.algebra.properties.IPhysicalPropertiesVector)1