public static final PlanNode findNodePreOrder(PlanNode root, int types) { return findNodePreOrder(root, types, NodeConstants.Types.NO_TYPE); }
public static final PlanNode findNodePreOrder(PlanNode root, int types) { return findNodePreOrder(root, types, NodeConstants.Types.NO_TYPE); }
public static final PlanNode findNodePreOrder(PlanNode root, int types) { return findNodePreOrder(root, types, NodeConstants.Types.NO_TYPE); }
private boolean mergeSortWithDupRemovalAcrossSource(PlanNode toTest) { PlanNode source = NodeEditor.findNodePreOrder(toTest, NodeConstants.Types.SOURCE, NodeConstants.Types.ACCESS | NodeConstants.Types.JOIN); return source != null && mergeSortWithDupRemoval(source); }
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 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 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; }
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)); }
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)); }
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 SymbolMap createSymbolMap(GroupSymbol group, List<? extends Expression> virtualElements, PlanNode child, QueryMetadataInterface metadata) throws TeiidComponentException, QueryMetadataException { List<ElementSymbol> projectedSymbols = defineNewGroup(group, virtualElements, metadata); SymbolMap symbolMap = SymbolMap.createSymbolMap(projectedSymbols, (List<Expression>)NodeEditor.findNodePreOrder(child, NodeConstants.Types.PROJECT).getProperty(NodeConstants.Info.PROJECT_COLS)); return symbolMap; }
static SymbolMap createSymbolMap(GroupSymbol group, List<? extends Expression> virtualElements, PlanNode child, QueryMetadataInterface metadata) throws TeiidComponentException, QueryMetadataException { List<ElementSymbol> projectedSymbols = defineNewGroup(group, virtualElements, metadata); SymbolMap symbolMap = SymbolMap.createSymbolMap(projectedSymbols, (List<Expression>)NodeEditor.findNodePreOrder(child, NodeConstants.Types.PROJECT).getProperty(NodeConstants.Info.PROJECT_COLS)); return symbolMap; }
static SymbolMap createSymbolMap(GroupSymbol group, List<? extends Expression> virtualElements, PlanNode child, QueryMetadataInterface metadata) throws TeiidComponentException, QueryMetadataException { List<ElementSymbol> projectedSymbols = defineNewGroup(group, virtualElements, metadata); SymbolMap symbolMap = SymbolMap.createSymbolMap(projectedSymbols, (List<Expression>)NodeEditor.findNodePreOrder(child, NodeConstants.Types.PROJECT).getProperty(NodeConstants.Info.PROJECT_COLS)); return symbolMap; }
/** * Finds the closest project columns in the current frame */ static List<Expression> findTopCols(PlanNode node) { PlanNode project = NodeEditor.findNodePreOrder(node, NodeConstants.Types.PROJECT, NodeConstants.Types.SOURCE); if (project == null) { project = NodeEditor.findParent(node, NodeConstants.Types.PROJECT, NodeConstants.Types.SOURCE); } if (project != null) { return (List<Expression>)project.getProperty(NodeConstants.Info.PROJECT_COLS); } Assertion.failed("no top cols in frame"); //$NON-NLS-1$ return null; }
/** * Finds the closest project columns in the current frame */ static List<Expression> findTopCols(PlanNode node) { PlanNode project = NodeEditor.findNodePreOrder(node, NodeConstants.Types.PROJECT, NodeConstants.Types.SOURCE); if (project == null) { project = NodeEditor.findParent(node, NodeConstants.Types.PROJECT, NodeConstants.Types.SOURCE); } if (project != null) { return (List<Expression>)project.getProperty(NodeConstants.Info.PROJECT_COLS); } Assertion.failed("no top cols in frame"); //$NON-NLS-1$ return null; }
/** * Finds the closest project columns in the current frame */ static List<Expression> findTopCols(PlanNode node) { PlanNode project = NodeEditor.findNodePreOrder(node, NodeConstants.Types.PROJECT, NodeConstants.Types.SOURCE); if (project == null) { project = NodeEditor.findParent(node, NodeConstants.Types.PROJECT, NodeConstants.Types.SOURCE); } if (project != null) { return (List<Expression>)project.getProperty(NodeConstants.Info.PROJECT_COLS); } Assertion.failed("no top cols in frame"); //$NON-NLS-1$ return null; }
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; }
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; }
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$ }