Java Code Examples for org.apache.calcite.sql.SqlSetOperator#createCall()

The following examples show how to use org.apache.calcite.sql.SqlSetOperator#createCall() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SqlImplementor.java    From Bats with Apache License 2.0 5 votes vote down vote up
public Result setOpToSql(SqlSetOperator operator, RelNode rel) {
    SqlNode node = null;
    for (Ord<RelNode> input : Ord.zip(rel.getInputs())) {
        final Result result = visitChild(input.i, input.e);
        if (node == null) {
            node = result.asSelect();
        } else {
            node = operator.createCall(POS, node, result.asSelect());
        }
    }
    final List<Clause> clauses = FluentListUtils.list(Clause.SET_OP);
    return result(node, clauses, rel, null);
}
 
Example 2
Source File: SqlImplementor.java    From dremio-oss with Apache License 2.0 5 votes vote down vote up
public Result setOpToSql(SqlSetOperator operator, RelNode rel) {
  SqlNode node = null;
  for (Ord<RelNode> input : Ord.zip(rel.getInputs())) {
    final Result result = visitChild(input.i, input.e);
    if (node == null) {
      node = result.asSelect();
    } else {
      node = operator.createCall(POS, node, result.asSelect());
    }
  }
  final List<Clause> clauses =
    Expressions.list(Clause.SET_OP);
  return result(node, clauses, rel, null);
}
 
Example 3
Source File: RelToSqlConverter.java    From quark with Apache License 2.0 5 votes vote down vote up
private Result setOpToSql(SqlSetOperator operator, RelNode rel) {
  List<SqlNode> list = Expressions.list();
  for (Ord<RelNode> input : Ord.zip(rel.getInputs())) {
    final Result result = this.visitChild(input.i, input.e);
    list.add(result.asSelect());
  }
  final SqlCall node = operator.createCall(new SqlNodeList(list, POS));
  final List<Clause> clauses =
      Expressions.list(Clause.SET_OP);
  return result(node, clauses, rel);
}
 
Example 4
Source File: SqlImplementor.java    From calcite with Apache License 2.0 5 votes vote down vote up
public Result setOpToSql(SqlSetOperator operator, RelNode rel) {
  SqlNode node = null;
  for (Ord<RelNode> input : Ord.zip(rel.getInputs())) {
    final Result result = visitChild(input.i, input.e);
    if (node == null) {
      node = result.asSelect();
    } else {
      node = operator.createCall(POS, node, result.asSelect());
    }
  }
  final List<Clause> clauses =
      Expressions.list(Clause.SET_OP);
  return result(node, clauses, rel, null);
}