Package org.openrdf.sail.rdbms.algebra

Examples of org.openrdf.sail.rdbms.algebra.UnionItem


  private SqlJoinBuilder subJoinAndFilter(SqlJoinBuilder query, FromItem from)
    throws RdbmsException, UnsupportedRdbmsOperatorException
  {
    if (from instanceof UnionItem) {
      UnionItem union = (UnionItem)from;
      List<String> names = union.getSelectVarNames();
      List<ColumnVar> vars = union.appendVars(new ArrayList<ColumnVar>());
      SqlQueryBuilder subquery = query.subquery();
      for (FromItem item : union.getUnion()) {
        for (int i = 0, n = names.size(); i < n; i++) {
          ColumnVar var = item.getVar(names.get(i));
          SqlExprBuilder select = subquery.select();
          if (var == null) {
            select.appendNull();
View Full Code Here


      if (sq.isComplex()) {
        return;
      }
    }
    assert node.getNumberOfArguments() > 0;
    UnionItem union = new UnionItem("u" + aliasCount++);
    SelectQuery query = new SelectQuery();
    query.setFrom(union);
    for (TupleExpr arg : node.getArgs()) {
      SelectQuery sub = (SelectQuery)arg.clone();
      union.addUnion(sub.getFrom().clone());
      mergeSelectClause(query, sub);
    }
    addProjectionsFromUnion(query, union);
    node.replaceWith(query);
  }
View Full Code Here

      return;
    SelectQuery left = (SelectQuery)l;
    SelectQuery right = (SelectQuery)r;
    if (left.isComplex() || right.isComplex())
      return;
    UnionItem union = new UnionItem("u" + aliasCount++);
    union.addUnion(left.getFrom().clone());
    union.addUnion(right.getFrom().clone());
    SelectQuery query = new SelectQuery();
    query.setFrom(union);
    mergeSelectClause(query, left);
    mergeSelectClause(query, right);
    node.replaceWith(query);
View Full Code Here

  }

  private SqlJoinBuilder subJoinAndFilter(SqlJoinBuilder query, FromItem from)
      throws RdbmsException, UnsupportedRdbmsOperatorException {
    if (from instanceof UnionItem) {
      UnionItem union = (UnionItem) from;
      List<String> names = union.getSelectVarNames();
      List<ColumnVar> vars = union.appendVars(new ArrayList<ColumnVar>());
      SqlQueryBuilder subquery = query.subquery();
      for (FromItem item : union.getUnion()) {
        for (int i = 0, n = names.size(); i < n; i++) {
          ColumnVar var = item.getVar(names.get(i));
          SqlExprBuilder select = subquery.select();
          if (var == null) {
            select.appendNull();
View Full Code Here

TOP

Related Classes of org.openrdf.sail.rdbms.algebra.UnionItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.