/** * Attach DUP_REMOVE node at top of tree. The DUP_REMOVE may be pushed down * to a source (or sources) if possible by the optimizer. * @param plan Existing plan * @return Updated plan */ private static PlanNode attachDupRemoval(PlanNode plan) { PlanNode dupNode = NodeFactory.getNewNode(NodeConstants.Types.DUP_REMOVE); attachLast(dupNode, plan); return dupNode; }
/** * Attach DUP_REMOVE node at top of tree. The DUP_REMOVE may be pushed down * to a source (or sources) if possible by the optimizer. * @param plan Existing plan * @return Updated plan */ private static PlanNode attachDupRemoval(PlanNode plan) { PlanNode dupNode = NodeFactory.getNewNode(NodeConstants.Types.DUP_REMOVE); attachLast(dupNode, plan); return dupNode; }
/** * Attach DUP_REMOVE node at top of tree. The DUP_REMOVE may be pushed down * to a source (or sources) if possible by the optimizer. * @param plan Existing plan * @return Updated plan */ private static PlanNode attachDupRemoval(PlanNode plan) { PlanNode dupNode = NodeFactory.getNewNode(NodeConstants.Types.DUP_REMOVE); attachLast(dupNode, plan); return dupNode; }
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; }
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 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; }
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; }
private static PlanNode createSortNode(List<Expression> orderSymbols, Collection<Expression> outputElements) { PlanNode sortNode = NodeFactory.getNewNode(NodeConstants.Types.SORT); OrderBy order = new OrderBy(orderSymbols); sortNode.setProperty(NodeConstants.Info.SORT_ORDER, order); sortNode.setProperty(NodeConstants.Info.OUTPUT_COLS, new ArrayList<Expression>(outputElements)); return sortNode; }
private void addEmptyFilter(Collection<AggregateSymbol> aggregates, PlanNode stageGroup, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, Object modelId) throws QueryMetadataException, TeiidComponentException { PlanNode selectNode = NodeFactory.getNewNode(NodeConstants.Types.SELECT); AggregateSymbol count = new AggregateSymbol(NonReserved.COUNT, false, null); aggregates.add(count); //consider the count aggregate for the push down call below Criteria crit = new CompareCriteria(count, CompareCriteria.GT, new Constant(new Integer(0))); selectNode.setProperty(NodeConstants.Info.SELECT_CRITERIA, crit); selectNode.setProperty(NodeConstants.Info.IS_HAVING, Boolean.TRUE); stageGroup.addAsParent(selectNode); }
private void addEmptyFilter(Collection<AggregateSymbol> aggregates, PlanNode stageGroup, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, Object modelId) throws QueryMetadataException, TeiidComponentException { PlanNode selectNode = NodeFactory.getNewNode(NodeConstants.Types.SELECT); AggregateSymbol count = new AggregateSymbol(NonReserved.COUNT, false, null); aggregates.add(count); //consider the count aggregate for the push down call below Criteria crit = new CompareCriteria(count, CompareCriteria.GT, new Constant(new Integer(0))); selectNode.setProperty(NodeConstants.Info.SELECT_CRITERIA, crit); selectNode.setProperty(NodeConstants.Info.IS_HAVING, Boolean.TRUE); stageGroup.addAsParent(selectNode); }
private void addEmptyFilter(Collection<AggregateSymbol> aggregates, PlanNode stageGroup, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, Object modelId) throws QueryMetadataException, TeiidComponentException { PlanNode selectNode = NodeFactory.getNewNode(NodeConstants.Types.SELECT); AggregateSymbol count = new AggregateSymbol(NonReserved.COUNT, false, null); aggregates.add(count); //consider the count aggregate for the push down call below Criteria crit = new CompareCriteria(count, CompareCriteria.GT, new Constant(new Integer(0))); selectNode.setProperty(NodeConstants.Info.SELECT_CRITERIA, crit); selectNode.setProperty(NodeConstants.Info.IS_HAVING, Boolean.TRUE); stageGroup.addAsParent(selectNode); }
public static PlanNode createProjectNode(List<? extends Expression> select) { PlanNode projectNode = NodeFactory.getNewNode(NodeConstants.Types.PROJECT); projectNode.setProperty(NodeConstants.Info.PROJECT_COLS, select); // Set groups projectNode.addGroups(GroupsUsedByElementsVisitor.getGroups(select)); return projectNode; }
public static PlanNode createProjectNode(List<? extends Expression> select) { PlanNode projectNode = NodeFactory.getNewNode(NodeConstants.Types.PROJECT); projectNode.setProperty(NodeConstants.Info.PROJECT_COLS, select); // Set groups projectNode.addGroups(GroupsUsedByElementsVisitor.getGroups(select)); return projectNode; }
private static PlanNode createSortNode(List<Expression> orderSymbols, Collection<Expression> outputElements) { PlanNode sortNode = NodeFactory.getNewNode(NodeConstants.Types.SORT); OrderBy order = new OrderBy(orderSymbols); order.setUserOrdering(false); sortNode.setProperty(NodeConstants.Info.SORT_ORDER, order); sortNode.setProperty(NodeConstants.Info.OUTPUT_COLS, new ArrayList<Expression>(outputElements)); return sortNode; }
private static PlanNode createSortNode(List<Expression> orderSymbols, Collection<Expression> outputElements) { PlanNode sortNode = NodeFactory.getNewNode(NodeConstants.Types.SORT); OrderBy order = new OrderBy(orderSymbols); order.setUserOrdering(false); sortNode.setProperty(NodeConstants.Info.SORT_ORDER, order); sortNode.setProperty(NodeConstants.Info.OUTPUT_COLS, new ArrayList<Expression>(outputElements)); return sortNode; }
public static PlanNode createProjectNode(List<? extends Expression> select) { PlanNode projectNode = NodeFactory.getNewNode(NodeConstants.Types.PROJECT); projectNode.setProperty(NodeConstants.Info.PROJECT_COLS, select); // Set groups projectNode.addGroups(GroupsUsedByElementsVisitor.getGroups(select)); return projectNode; }
private static PlanNode helpGetJoinNode(float childCost1, float childCost2, JoinType joinType){ PlanNode joinNode = NodeFactory.getNewNode(NodeConstants.Types.JOIN); PlanNode child1 = NodeFactory.getNewNode(NodeConstants.Types.ACCESS); PlanNode child2 = NodeFactory.getNewNode(NodeConstants.Types.ACCESS); joinNode.addLastChild(child1); joinNode.addLastChild(child2); child1.setProperty(NodeConstants.Info.EST_CARDINALITY, new Float(childCost1)); child2.setProperty(NodeConstants.Info.EST_CARDINALITY, new Float(childCost2)); joinNode.setProperty(NodeConstants.Info.JOIN_TYPE, joinType); return joinNode; }
@Test public void testFindNoAllUnion1() { PlanNode projNode = NodeFactory.getNewNode(NodeConstants.Types.PROJECT); PlanNode accessNode = NodeFactory.getNewNode(NodeConstants.Types.ACCESS); projNode.addLastChild(accessNode); helpTestIsUnionNoAll(projNode, false); }