/** * TODO This seems to be inefficient. We do not need to proceed * {@link SubqueryBase} by {@link SubqueryBase}. * {@link BOpUtility#visitAll(BOp, Class)} can be used to locate all * INCLUDEs in the entire query and then we can build up whatever indices we * need in optimize() and use them elsewhere as required. */ static private List<NamedSubqueryInclude> findSubqueryIncludes(final SubqueryBase queryRoot){ final Striterator itr = new Striterator( BOpUtility.postOrderIterator((BOp) queryRoot.getWhereClause())); itr.addTypeFilter(NamedSubqueryInclude.class); final List<NamedSubqueryInclude> list = new LinkedList<NamedSubqueryInclude>(); while (itr.hasNext()) { list.add((NamedSubqueryInclude) itr.next()); } final Striterator itr2 = new Striterator( BOpUtility.postOrderIterator((BOp) queryRoot.getWhereClause())); itr2.addTypeFilter(SubqueryRoot.class); while (itr2.hasNext()) { list.addAll(findSubqueryIncludes((SubqueryRoot) itr2.next())); } return list; }
/** * TODO This seems to be inefficient. We do not need to proceed * {@link SubqueryBase} by {@link SubqueryBase}. * {@link BOpUtility#visitAll(BOp, Class)} can be used to locate all * INCLUDEs in the entire query and then we can build up whatever indices we * need in optimize() and use them elsewhere as required. */ static private List<NamedSubqueryInclude> findSubqueryIncludes(final SubqueryBase queryRoot){ final Striterator itr = new Striterator( BOpUtility.postOrderIterator((BOp) queryRoot.getWhereClause())); itr.addTypeFilter(NamedSubqueryInclude.class); final List<NamedSubqueryInclude> list = new LinkedList<NamedSubqueryInclude>(); while (itr.hasNext()) { list.add((NamedSubqueryInclude) itr.next()); } final Striterator itr2 = new Striterator( BOpUtility.postOrderIterator((BOp) queryRoot.getWhereClause())); itr2.addTypeFilter(SubqueryRoot.class); while (itr2.hasNext()) { list.addAll(findSubqueryIncludes((SubqueryRoot) itr2.next())); } return list; }
subqueryRoot.getWhereClause(), StatementPatternNode.class); new Object[] { whereClause, subqueryRoot.getWhereClause() }, visitQueryHints(astContainer.getOptimizedAST(), QueryHints.OPTIMIZER)); assertNotNull(subqueryRoot.getWhereClause().getQueryHint(PipelineOp.Annotations.CHUNK_CAPACITY)); assertNotNull(subqueryRootSP.getQueryHint(PipelineOp.Annotations.CHUNK_CAPACITY)); assertNotNull(subqueryRoot.getSlice().getQueryHint(PipelineOp.Annotations.CHUNK_CAPACITY));
subqueryRoot.getWhereClause(), StatementPatternNode.class); new Object[] { whereClause, subqueryRoot.getWhereClause() }, visitQueryHints(astContainer.getOptimizedAST(), QueryHints.OPTIMIZER)); assertNotNull(subqueryRoot.getWhereClause().getQueryHint(PipelineOp.Annotations.CHUNK_CAPACITY)); assertNotNull(subqueryRootSP.getQueryHint(PipelineOp.Annotations.CHUNK_CAPACITY)); assertNotNull(subqueryRoot.getSlice().getQueryHint(PipelineOp.Annotations.CHUNK_CAPACITY));
subqueryRoot.getWhereClause(), StatementPatternNode.class); new Object[] { whereClause, subqueryRoot.getWhereClause() }, visitQueryHints(astContainer.getOptimizedAST(), QueryHints.OPTIMIZER)); assertNotNull(subqueryRoot.getWhereClause().getQueryHint(PipelineOp.Annotations.CHUNK_CAPACITY)); assertNotNull(subqueryRootSP.getQueryHint(PipelineOp.Annotations.CHUNK_CAPACITY)); assertNotNull(subqueryRoot.getSlice().getQueryHint(PipelineOp.Annotations.CHUNK_CAPACITY));