Search in sources :

Example 1 with InMemoryHashJoinPOperator

use of org.apache.hyracks.algebricks.core.algebra.operators.physical.InMemoryHashJoinPOperator in project asterixdb by apache.

the class JoinUtils method hybridToInMemHashJoin.

private static void hybridToInMemHashJoin(AbstractBinaryJoinOperator op, IOptimizationContext context) throws AlgebricksException {
    ILogicalOperator opBuild = op.getInputs().get(1).getValue();
    LogicalPropertiesVisitor.computeLogicalPropertiesDFS(opBuild, context);
    ILogicalPropertiesVector v = context.getLogicalPropertiesVector(opBuild);
    AlgebricksConfig.ALGEBRICKS_LOGGER.fine("// HybridHashJoin inner branch -- Logical properties for " + opBuild + ": " + v + "\n");
    if (v != null) {
        int size2 = v.getMaxOutputFrames();
        HybridHashJoinPOperator hhj = (HybridHashJoinPOperator) op.getPhysicalOperator();
        if (size2 > 0 && size2 * hhj.getFudgeFactor() <= hhj.getMemSizeInFrames()) {
            AlgebricksConfig.ALGEBRICKS_LOGGER.fine("// HybridHashJoin inner branch " + opBuild + " fits in memory\n");
            // maintains the local properties on the probe side
            op.setPhysicalOperator(new InMemoryHashJoinPOperator(hhj.getKind(), hhj.getPartitioningType(), hhj.getKeysLeftBranch(), hhj.getKeysRightBranch(), v.getNumberOfTuples() * 2, hhj.getMemSizeInFrames()));
        }
    }
}
Also used : ILogicalPropertiesVector(org.apache.hyracks.algebricks.core.algebra.properties.ILogicalPropertiesVector) HybridHashJoinPOperator(org.apache.hyracks.algebricks.core.algebra.operators.physical.HybridHashJoinPOperator) ILogicalOperator(org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator) InMemoryHashJoinPOperator(org.apache.hyracks.algebricks.core.algebra.operators.physical.InMemoryHashJoinPOperator)

Aggregations

ILogicalOperator (org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator)1 HybridHashJoinPOperator (org.apache.hyracks.algebricks.core.algebra.operators.physical.HybridHashJoinPOperator)1 InMemoryHashJoinPOperator (org.apache.hyracks.algebricks.core.algebra.operators.physical.InMemoryHashJoinPOperator)1 ILogicalPropertiesVector (org.apache.hyracks.algebricks.core.algebra.properties.ILogicalPropertiesVector)1