def includePhysicalOperatorsUnionBlock(query, ub, a, wc, buffersize, c): r = [] #print "ub.triples", ub.triples for jb in ub.triples: r.append(includePhysicalOperatorsJoinBlock(query, jb, a, wc, buffersize, c)) while len(r) > 1: left = r.pop(0) right = r.pop(0) all_variables = left.vars | right.vars if a: n = TreePlan(Xunion(left.vars, right.vars), all_variables, left, right) else: n = TreePlan(Union(left.vars, right.vars, query.distinct), all_variables, left, right) r.append(n) if len(r) == 1: n = r[0] for f in ub.filters: n = TreePlan(Xfilter(f),n.vars,n) return n else: return None
def includePhysicalOperatorsUnionBlock(simulated, query, ub, a, wc, buffersize): r = [] for jb in ub.triples: r.append( includePhysicalOperatorsJoinBlock(simulated, query, jb, a, wc, buffersize)) while len(r) > 1: left = r.pop(0) right = r.pop(0) all_variables = left.vars | right.vars if a: n = TreePlan(Xunion(left.vars, right.vars, query.distinct), all_variables, left, right) else: n = TreePlan(Union(left.vars, right.vars, query.distinct), all_variables, left, right) r.append(n) if len(r) == 1: return r[0] else: return None