public static SqlSelectBlock makeSelect(SqlDistinct node) {
    SqlSelectBlock result = _makeSelect(node.getSubNode());
    result.setDistinct(true);

    // Sort conditions must now become part of the projection

    return result;
  }
  public static SqlSelectBlock makeSelect(SqlNodeOrder node) {
    SqlSelectBlock result = _makeSelect(node.getSubNode());
    result.getSortConditions().addAll(node.getConditions());

    copyProjection(result, node);

    return result;
  }
  public static SqlSelectBlock makeSelect(SqlProjection node) {
    SqlSelectBlock result = _makeSelect(node.getSubNode());

    // If the node is distinct, or if it already has a projection set,
    // we must create a subselect
    if (result.isDistinct()) { // || result.isResultStar()
      // SqlSelectBlock wrapped = new

    }

    SqlSelectBlock wrap = new SqlSelectBlock(node.getAliasName(), result);
    wrap.getSparqlVarToExprs().putAll(node.getSparqlVarToExprs());
    wrap.getAliasToColumn().putAll(node.getAliasToColumn());

    return wrap;
  }
  public static SqlSelectBlock makeSelect(SqlGroup node) {
    SqlSelectBlock result;

    if (node.getSubNode() instanceof SqlSlice) {

      SqlSelectBlock tmp = _makeSelect(node.getSubNode());

      result = new SqlSelectBlock(tmp.getAliasName(), tmp);
      copyProjection(result, result);

    } else {
      result = _makeSelect(node.getSubNode());
    }

    System.err.println("TODO Handle group by vars if present");

    return result;
  }
  public static SqlSelectBlock makeSelect(SqlSlice node) {
    SqlSelectBlock result = _makeSelect(node.getSubNode());
    SqlSelectBlock.slice(null, result, node.getStart(), node.getLength());

    return result;
  }
  public static SqlSelectBlock makeSelect(SqlMyRestrict node) {
    SqlSelectBlock result = _makeSelect(node.getSubNode());
    result.getConditions().addAll(node.getConditions());

    return result;
  }