private boolean isDependentFinalDestination(PlanNode critNode, PlanNode currentNode) { return critNode.hasBooleanProperty(NodeConstants.Info.IS_DEPENDENT_SET) && NodeEditor.findNodePreOrder(currentNode.getFirstChild(), NodeConstants.Types.GROUP, NodeConstants.Types.SOURCE) == null; }
private static PlanNode newLimit(PlanNode limitNode) { PlanNode newLimit = NodeFactory.getNewNode(NodeConstants.Types.TUPLE_LIMIT); if (limitNode.hasBooleanProperty(Info.IS_NON_STRICT)) { newLimit.setProperty(Info.IS_NON_STRICT, Boolean.TRUE); } return newLimit; }
static PlanNode createJoinNode() { PlanNode joinNode = NodeFactory.getNewNode(NodeConstants.Types.JOIN); joinNode.setProperty(NodeConstants.Info.JOIN_TYPE, JoinType.JOIN_CROSS); joinNode.setProperty(NodeConstants.Info.JOIN_STRATEGY, JoinStrategyType.NESTED_LOOP); return joinNode; }
static PlanNode createSource(GroupSymbol group, PlanNode child, List<ElementSymbol> newProject) { PlanNode branchSource = NodeFactory.getNewNode(NodeConstants.Types.SOURCE); branchSource.addGroup(group); PlanNode projectNode = NodeEditor.findNodePreOrder(child, NodeConstants.Types.PROJECT); branchSource.setProperty(Info.SYMBOL_MAP, SymbolMap.createSymbolMap(newProject, (List<? extends Expression>)projectNode.getProperty(Info.PROJECT_COLS))); child.addAsParent(branchSource); return branchSource; }
public void testFindNodePreOrder1() { PlanNode node1 = NodeFactory.getNewNode(NodeConstants.Types.PROJECT); PlanNode node2 = NodeFactory.getNewNode(NodeConstants.Types.JOIN); PlanNode node3 = NodeFactory.getNewNode(NodeConstants.Types.ACCESS); PlanNode node4 = NodeFactory.getNewNode(NodeConstants.Types.ACCESS); node1.addLastChild(node2); node2.addLastChild(node3); node2.addLastChild(node4); assertEquals("Found wrong node", node1, NodeEditor.findNodePreOrder(node1, NodeConstants.Types.PROJECT)); //$NON-NLS-1$ assertEquals("Found wrong node", node2, NodeEditor.findNodePreOrder(node1, NodeConstants.Types.JOIN)); //$NON-NLS-1$ assertEquals("Found wrong node", node3, NodeEditor.findNodePreOrder(node1, NodeConstants.Types.ACCESS)); //$NON-NLS-1$ assertEquals("Found wrong node", null, NodeEditor.findNodePreOrder(node1, NodeConstants.Types.GROUP)); //$NON-NLS-1$ assertEquals("Found wrong node", null, NodeEditor.findNodePreOrder(node1, NodeConstants.Types.ACCESS, NodeConstants.Types.JOIN)); //$NON-NLS-1$ }
public static boolean isOrderedOrStrictLimit(PlanNode node) { return node.getType() == NodeConstants.Types.TUPLE_LIMIT && (NodeEditor.findNodePreOrder(node, NodeConstants.Types.SORT, NodeConstants.Types.PROJECT | NodeConstants.Types.SET_OP) != null || !node.hasBooleanProperty(Info.IS_NON_STRICT)); }
/** * Add the node as this node's parent. * @param node */ public void addAsParent(PlanNode node) { modified = true; if (this.parent != null) { this.parent.replaceChild(this, node); } assert node.getChildCount() == 0; node.addLastChild(this); }
public void addChildren(Collection<PlanNode> otherChildren) { for (PlanNode planNode : otherChildren) { this.addLastChild(planNode); } }
public PlanNode removeFromParent() { this.modified = true; PlanNode result = this.parent; if (result != null) { result.removeChild(this); } return result; }
static PlanNode createSource(GroupSymbol group, PlanNode child, List<ElementSymbol> newProject) { PlanNode branchSource = NodeFactory.getNewNode(NodeConstants.Types.SOURCE); branchSource.addGroup(group); PlanNode projectNode = NodeEditor.findNodePreOrder(child, NodeConstants.Types.PROJECT); branchSource.setProperty(Info.SYMBOL_MAP, SymbolMap.createSymbolMap(newProject, (List<? extends Expression>)projectNode.getProperty(Info.PROJECT_COLS))); child.addAsParent(branchSource); return branchSource; }
private boolean isDependentFinalDestination(PlanNode critNode, PlanNode currentNode) { return critNode.hasBooleanProperty(NodeConstants.Info.IS_DEPENDENT_SET) && NodeEditor.findNodePreOrder(currentNode.getFirstChild(), NodeConstants.Types.GROUP, NodeConstants.Types.SOURCE) == null; }
private static PlanNode newLimit(PlanNode limitNode) { PlanNode newLimit = NodeFactory.getNewNode(NodeConstants.Types.TUPLE_LIMIT); if (limitNode.hasBooleanProperty(Info.IS_NON_STRICT)) { newLimit.setProperty(Info.IS_NON_STRICT, Boolean.TRUE); } return newLimit; }
public static boolean isOrderedOrStrictLimit(PlanNode node) { return node.getType() == NodeConstants.Types.TUPLE_LIMIT && (NodeEditor.findNodePreOrder(node, NodeConstants.Types.SORT, NodeConstants.Types.PROJECT | NodeConstants.Types.SET_OP) != null || !node.hasBooleanProperty(Info.IS_NON_STRICT)); }
static PlanNode createJoinNode() { PlanNode joinNode = NodeFactory.getNewNode(NodeConstants.Types.JOIN); joinNode.setProperty(NodeConstants.Info.JOIN_TYPE, JoinType.JOIN_CROSS); joinNode.setProperty(NodeConstants.Info.JOIN_STRATEGY, JoinStrategyType.NESTED_LOOP); return joinNode; }
static final void attachLast(PlanNode parent, PlanNode child) { if(child != null) { parent.addLastChild(child); } }
static PlanNode createSource(GroupSymbol group, PlanNode child, List<ElementSymbol> newProject) { PlanNode branchSource = NodeFactory.getNewNode(NodeConstants.Types.SOURCE); branchSource.addGroup(group); PlanNode projectNode = NodeEditor.findNodePreOrder(child, NodeConstants.Types.PROJECT); branchSource.setProperty(Info.SYMBOL_MAP, SymbolMap.createSymbolMap(newProject, (List<? extends Expression>)projectNode.getProperty(Info.PROJECT_COLS))); child.addAsParent(branchSource); return branchSource; }
private boolean isDependentFinalDestination(PlanNode critNode, PlanNode currentNode) { return critNode.hasBooleanProperty(NodeConstants.Info.IS_DEPENDENT_SET) && NodeEditor.findNodePreOrder(currentNode.getFirstChild(), NodeConstants.Types.GROUP, NodeConstants.Types.SOURCE) == null; }
private static PlanNode newLimit(PlanNode limitNode) { PlanNode newLimit = NodeFactory.getNewNode(NodeConstants.Types.TUPLE_LIMIT); if (limitNode.hasBooleanProperty(Info.IS_NON_STRICT)) { newLimit.setProperty(Info.IS_NON_STRICT, Boolean.TRUE); } return newLimit; }
static PlanNode createJoinNode() { PlanNode joinNode = NodeFactory.getNewNode(NodeConstants.Types.JOIN); joinNode.setProperty(NodeConstants.Info.JOIN_TYPE, JoinType.JOIN_CROSS); joinNode.setProperty(NodeConstants.Info.JOIN_STRATEGY, JoinStrategyType.NESTED_LOOP); return joinNode; }