protected GroupMemberNodeBase namedSubQueryInclude( final String name, ApplyAnnotation ... annotations) { return applyAnnotations(new NamedSubqueryInclude(name), annotations); }
final NamedSubqueryInclude include = new NamedSubqueryInclude(newName); include.setQueryHints((Properties) parent .getProperty(ASTBase.Annotations.QUERY_HINTS)); include.setAttachedJoinFilters(subqueryRoot.getAttachedJoinFilters());
if (namedSet.equals(anInclude.getName())) { final IVariable[] joinvars; if (anInclude.getJoinVars() == null) { anInclude.setJoinVars(ASTUtil.convert(joinvars)); joinvars = ASTUtil.convert(anInclude.getJoinVars()); anInclude.setJoinVars(ASTUtil.convert(joinvars)); anInclude.setJoinVars(sharedJoinVars);
@SuppressWarnings("serial") public void testNamedSubquery() { final NamedSubqueryInclude nsi = (NamedSubqueryInclude) new Helper() {{ tmp = namedSubQueryInclude("_set1"); }}.getTmp(); final QueryRoot query = (QueryRoot) new Helper(){{ tmp = select( varNodes(x,y,y), namedSubQuery("_set1",varNode(x),where(statementPatternNode(varNode(x), constantNode(a), constantNode(b),1))), where(nsi,statementPatternNode(varNode(x), constantNode(c), varNode(y),1,OPTIONAL) ) ); }}.getTmp(); final AST2BOpContext context = new AST2BOpContext(new ASTContainer(query), store); final StaticAnalysis sa = new StaticAnalysis(query, context); final Set<IVariable<?>> requiredBound = new HashSet<IVariable<?>>(); final Set<IVariable<?>> desiredBound = new HashSet<IVariable<?>>() {{ add(Var.var("x")); }}; assertEquals(requiredBound, nsi.getRequiredBound(sa)); assertEquals(desiredBound, nsi.getDesiredBound(sa)); }
Scope.DEFAULT_CONTEXTS)); final NamedSubqueryInclude nsi = new NamedSubqueryInclude(name); nsi.setAttachedJoinFilters(new LinkedList<FilterNode>()); whereClause.addChild(nsi);
whereClause.addChild(new NamedSubqueryInclude(set1)); whereClause.addChild(new NamedSubqueryInclude(set1)); whereClause.addChild(new NamedSubqueryInclude(set2)); whereClause.addChild(new NamedSubqueryInclude(set3)); final NamedSubqueryInclude nsi1 = new NamedSubqueryInclude(set1); nsi1.setJoinVars(new VarNode[]{/*none*/}); final NamedSubqueryInclude nsi1 = new NamedSubqueryInclude(set1); nsi1.setJoinVars(new VarNode[]{/*none*/}); expected.setWhereClause(whereClause); final NamedSubqueryInclude nsi2 = new NamedSubqueryInclude(set2); nsi2.setJoinVars(new VarNode[]{/*none*/}); final NamedSubqueryInclude nsi3 = new NamedSubqueryInclude(set3); nsi3.setJoinVars(new VarNode[]{new VarNode("var1")}); whereClause.addChild(nsi3);
foafPerson))); whereClause.addChild(include = new NamedSubqueryInclude( namedSet)); assertTrue(whereClause == include.getParent());
final NamedSubqueryInclude nsi = new NamedSubqueryInclude(namedSet); nsi.setQueryHints(p.getQueryHints());
assertNotNull(nsi.getQueryHint(PipelineOp.Annotations.CHUNK_CAPACITY)); assertNotNull(subqueryRoot.getQueryHint(PipelineOp.Annotations.CHUNK_CAPACITY));
Scope.DEFAULT_CONTEXTS)); final NamedSubqueryInclude nsi = new NamedSubqueryInclude(name); nsi.setAttachedJoinFilters(new LinkedList<FilterNode>()); whereClause.addChild(nsi);
whereClause.addChild(new NamedSubqueryInclude(set1)); whereClause.addChild(new NamedSubqueryInclude(set1)); whereClause.addChild(new NamedSubqueryInclude(set2)); whereClause.addChild(new NamedSubqueryInclude(set3)); final NamedSubqueryInclude nsi1 = new NamedSubqueryInclude(set1); nsi1.setJoinVars(new VarNode[]{/*none*/}); final NamedSubqueryInclude nsi1 = new NamedSubqueryInclude(set1); nsi1.setJoinVars(new VarNode[]{/*none*/}); expected.setWhereClause(whereClause); final NamedSubqueryInclude nsi2 = new NamedSubqueryInclude(set2); nsi2.setJoinVars(new VarNode[]{/*none*/}); final NamedSubqueryInclude nsi3 = new NamedSubqueryInclude(set3); nsi3.setJoinVars(new VarNode[]{new VarNode("var1")}); whereClause.addChild(nsi3);
foafPerson))); whereClause.addChild(include = new NamedSubqueryInclude( namedSet)); assertTrue(whereClause == include.getParent());
final NamedSubqueryInclude nsi = new NamedSubqueryInclude(namedSet); nsi.setQueryHints(p.getQueryHints());
@SuppressWarnings("serial") public void testNamedSubquery() { final NamedSubqueryInclude nsi = (NamedSubqueryInclude) new Helper() {{ tmp = namedSubQueryInclude("_set1"); }}.getTmp(); final QueryRoot query = (QueryRoot) new Helper(){{ tmp = select( varNodes(x,y,y), namedSubQuery("_set1",varNode(x),where(statementPatternNode(varNode(x), constantNode(a), constantNode(b),1))), where(nsi,statementPatternNode(varNode(x), constantNode(c), varNode(y),1,OPTIONAL) ) ); }}.getTmp(); final AST2BOpContext context = new AST2BOpContext(new ASTContainer(query), store); final StaticAnalysis sa = new StaticAnalysis(query, context); final Set<IVariable<?>> requiredBound = new HashSet<IVariable<?>>(); final Set<IVariable<?>> desiredBound = new HashSet<IVariable<?>>() {{ add(Var.var("x")); }}; assertEquals(requiredBound, nsi.getRequiredBound(sa)); assertEquals(desiredBound, nsi.getDesiredBound(sa)); }
assertNotNull(nsi.getQueryHint(PipelineOp.Annotations.CHUNK_CAPACITY)); assertNotNull(subqueryRoot.getQueryHint(PipelineOp.Annotations.CHUNK_CAPACITY));
protected GroupMemberNodeBase namedSubQueryInclude( final String name, ApplyAnnotation ... annotations) { return applyAnnotations(new NamedSubqueryInclude(name), annotations); }
Scope.DEFAULT_CONTEXTS)); final NamedSubqueryInclude nsi = new NamedSubqueryInclude(name); nsi.setAttachedJoinFilters(new LinkedList<FilterNode>()); whereClause.addChild(nsi);
given.setWhereClause(whereClause); whereClause.addChild(new NamedSubqueryInclude(namedSet1)); expected.setWhereClause(whereClause); final NamedSubqueryInclude nsi = new NamedSubqueryInclude(namedSet1); whereClause.addChild(nsi); nsi.setJoinVars(joinVars);
final NamedSubqueryInclude include = new NamedSubqueryInclude(newName); include.setQueryHints((Properties) parent .getProperty(ASTBase.Annotations.QUERY_HINTS)); include.setAttachedJoinFilters(subqueryRoot.getAttachedJoinFilters());
foafPerson))); whereClause.addChild(include = new NamedSubqueryInclude( namedSet)); assertTrue(whereClause == include.getParent());