/** * Gets the operator for this CoGroup node. * * @return The CoGroup operator. */ @Override public CoGroupOperatorBase<?, ?, ?, ?> getOperator() { return (CoGroupOperatorBase<?, ?, ?, ?>) super.getOperator(); }
/** * Gets the operator for this CoGroup node. * * @return The CoGroup operator. */ @Override public CoGroupRawOperatorBase<?, ?, ?, ?> getOperator() { return (CoGroupRawOperatorBase<?, ?, ?, ?>) super.getOperator(); }
/** * Gets the contract object for this match node. * * @return The contract. */ @Override public InnerJoinOperatorBase<?, ?, ?, ?> getOperator() { return (InnerJoinOperatorBase<?, ?, ?, ?>) super.getOperator(); }
@Override public OuterJoinOperatorBase<?, ?, ?, ?> getOperator() { return (OuterJoinOperatorBase<?, ?, ?, ?>) super.getOperator(); }
@Override public CrossOperatorBase<?, ?, ?, ?> getOperator() { return (CrossOperatorBase<?, ?, ?, ?>) super.getOperator(); }
@Override public SemanticProperties getSemanticProperties() { return getOperator().getSemanticProperties(); }
@Override public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) { String nodeName = "RightOuterJoin ("+node.getOperator().getName()+")"; return new DualInputPlanNode(node, nodeName, in1, in2, getStrategy(), this.keys1, this.keys2); }
@Override public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) { String nodeName = "FullOuterJoin ("+node.getOperator().getName()+")"; return new DualInputPlanNode(node, nodeName, in1, in2, getStrategy(), this.keys1, this.keys2); }
@Override public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) { String nodeName = "RightOuterJoin ("+node.getOperator().getName()+")"; return new DualInputPlanNode(node, nodeName, in1, in2, getStrategy(), this.keys1, this.keys2); }
@Override public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) { String nodeName = "LeftOuterJoin ("+node.getOperator().getName()+")"; return new DualInputPlanNode(node, nodeName, in1, in2, getStrategy(), this.keys1, this.keys2); }
@Override public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) { String nodeName = "FullOuterJoin ("+node.getOperator().getName()+")"; return new DualInputPlanNode(node, nodeName, in1, in2, getStrategy(), this.keys1, this.keys2); }
@Override public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) { String nodeName = "LeftOuterJoin ("+node.getOperator().getName()+")"; return new DualInputPlanNode(node, nodeName, in1, in2, getStrategy(), this.keys1, this.keys2); }
@Override public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) { return new DualInputPlanNode(node, "Cross ("+node.getOperator().getName()+")", in1, in2, getStrategy()); }
@Override public void setInput(Map<Operator<?>, OptimizerNode> contractToNode, ExecutionMode defaultExecutionMode) { final Configuration conf = getOperator().getParameters(); ShipStrategyType preSet1 = null; ShipStrategyType preSet2 = null; DualInputOperator<?, ?, ?, ?> contr = getOperator(); DagConnection conn1; if (leftPred == null) { throw new CompilerException("Error: Node for '" + getOperator().getName() + "' has no input set for first input."); } else { pred1 = contractToNode.get(leftPred); DagConnection conn2; if (rightPred == null) { throw new CompilerException("Error: Node for '" + getOperator().getName() + "' has no input set for second input."); } else { pred2 = contractToNode.get(rightPred);
@Override public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) { boolean[] inputOrders = in1.getLocalProperties().getOrdering().getFieldSortDirections(); if (inputOrders == null || inputOrders.length < this.keys1.size()) { throw new CompilerException("BUG: The input strategy does not sufficiently describe the sort orders for a merge operator."); } else if (inputOrders.length > this.keys1.size()) { boolean[] tmp = new boolean[this.keys1.size()]; System.arraycopy(inputOrders, 0, tmp, 0, tmp.length); inputOrders = tmp; } String nodeName = String.format("%s (%s)", getNodeName(), node.getOperator().getName()); return new DualInputPlanNode(node, nodeName, in1, in2, getStrategy(), this.keys1, this.keys2, inputOrders); }
@Override public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) { boolean[] inputOrders = in2.getLocalProperties().getOrdering() == null ? null : in2.getLocalProperties().getOrdering().getFieldSortDirections(); if (inputOrders == null || inputOrders.length < this.keys2.size()) { throw new CompilerException("BUG: The input strategy does not sufficiently describe the sort orders for a CoGroup operator."); } else if (inputOrders.length > this.keys2.size()) { boolean[] tmp = new boolean[this.keys2.size()]; System.arraycopy(inputOrders, 0, tmp, 0, tmp.length); inputOrders = tmp; } return new DualInputPlanNode(node, "CoGroup ("+node.getOperator().getName()+")", in1, in2, DriverStrategy.CO_GROUP, this.keys1, this.keys2, inputOrders); }
@Override public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) { boolean[] inputOrders = in1.getLocalProperties().getOrdering() == null ? null : in1.getLocalProperties().getOrdering().getFieldSortDirections(); if (inputOrders == null || inputOrders.length < this.keys1.size()) { throw new CompilerException("BUG: The input strategy does not sufficiently describe the sort orders for a CoGroup operator."); } else if (inputOrders.length > this.keys1.size()) { boolean[] tmp = new boolean[this.keys1.size()]; System.arraycopy(inputOrders, 0, tmp, 0, tmp.length); inputOrders = tmp; } return new DualInputPlanNode(node, "CoGroup ("+node.getOperator().getName()+")", in1, in2, DriverStrategy.CO_GROUP, this.keys1, this.keys2, inputOrders); }
@Override public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) { boolean[] inputOrders = in1.getLocalProperties().getOrdering() == null ? null : in1.getLocalProperties().getOrdering().getFieldSortDirections(); if (inputOrders == null || inputOrders.length < this.keys1.size()) { throw new CompilerException("BUG: The input strategy does not sufficiently describe the sort orders for a CoGroup operator."); } else if (inputOrders.length > this.keys1.size()) { boolean[] tmp = new boolean[this.keys1.size()]; System.arraycopy(inputOrders, 0, tmp, 0, tmp.length); inputOrders = tmp; } return new DualInputPlanNode(node, "CoGroup (" + node.getOperator().getName() + ")", in1, in2, DriverStrategy.CO_GROUP_RAW, this.keys1, this.keys2, inputOrders); }
@Override public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) { DriverStrategy strategy; if (!in2.isOnDynamicPath() && in1.isOnDynamicPath()) { // sanity check that the first input is cached and remove that cache if (!in2.getTempMode().isCached()) { throw new CompilerException("No cache at point where static and dynamic parts meet."); } in2.setTempMode(in2.getTempMode().makeNonCached()); strategy = DriverStrategy.HYBRIDHASH_BUILD_SECOND_CACHED; } else { strategy = DriverStrategy.HYBRIDHASH_BUILD_SECOND; } return new DualInputPlanNode(node, "Join ("+node.getOperator().getName()+")", in1, in2, strategy, this.keys1, this.keys2); }
@Override public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) { DriverStrategy strategy; if(!in1.isOnDynamicPath() && in2.isOnDynamicPath()) { // sanity check that the first input is cached and remove that cache if (!in1.getTempMode().isCached()) { throw new CompilerException("No cache at point where static and dynamic parts meet."); } in1.setTempMode(in1.getTempMode().makeNonCached()); strategy = DriverStrategy.HYBRIDHASH_BUILD_FIRST_CACHED; } else { strategy = DriverStrategy.HYBRIDHASH_BUILD_FIRST; } return new DualInputPlanNode(node, "Join ("+node.getOperator().getName()+")", in1, in2, strategy, this.keys1, this.keys2); }