Search in sources :

Example 6 with SetOperationRight

use of org.apache.asterix.lang.sqlpp.struct.SetOperationRight in project asterixdb by apache.

the class SqlppInlineUdfsVisitor method visit.

@Override
public Boolean visit(SelectSetOperation selectSetOperation, List<FunctionDecl> funcs) throws CompilationException {
    boolean changed = false;
    changed |= selectSetOperation.getLeftInput().accept(this, funcs);
    for (SetOperationRight right : selectSetOperation.getRightInputs()) {
        changed |= right.getSetOperationRightInput().accept(this, funcs);
    }
    return changed;
}
Also used : SetOperationRight(org.apache.asterix.lang.sqlpp.struct.SetOperationRight)

Example 7 with SetOperationRight

use of org.apache.asterix.lang.sqlpp.struct.SetOperationRight in project asterixdb by apache.

the class SqlppAstPrintVisitor method visit.

@Override
public Void visit(SelectSetOperation selectSetOperation, Integer step) throws CompilationException {
    selectSetOperation.getLeftInput().accept(this, step);
    if (selectSetOperation.hasRightInputs()) {
        for (SetOperationRight right : selectSetOperation.getRightInputs()) {
            String all = right.isSetSemantics() ? " ALL " : "";
            out.println(skip(step) + right.getSetOpType() + all);
            right.getSetOperationRightInput().accept(this, step + 1);
        }
    }
    return null;
}
Also used : SetOperationRight(org.apache.asterix.lang.sqlpp.struct.SetOperationRight)

Example 8 with SetOperationRight

use of org.apache.asterix.lang.sqlpp.struct.SetOperationRight in project asterixdb by apache.

the class SqlppFormatPrintVisitor method visit.

@Override
public Void visit(SelectSetOperation selectSetOperation, Integer step) throws CompilationException {
    selectSetOperation.getLeftInput().accept(this, step);
    if (selectSetOperation.hasRightInputs()) {
        for (SetOperationRight right : selectSetOperation.getRightInputs()) {
            String all = right.isSetSemantics() ? " " : " all ";
            out.print(right.getSetOpType() + all);
            right.getSetOperationRightInput().accept(this, step);
        }
    }
    return null;
}
Also used : SetOperationRight(org.apache.asterix.lang.sqlpp.struct.SetOperationRight)

Aggregations

SetOperationRight (org.apache.asterix.lang.sqlpp.struct.SetOperationRight)8 ArrayList (java.util.ArrayList)3 SelectSetOperation (org.apache.asterix.lang.sqlpp.clause.SelectSetOperation)3 SelectExpression (org.apache.asterix.lang.sqlpp.expression.SelectExpression)3 SetOperationInput (org.apache.asterix.lang.sqlpp.struct.SetOperationInput)3 ILangExpression (org.apache.asterix.lang.common.base.ILangExpression)2 SelectBlock (org.apache.asterix.lang.sqlpp.clause.SelectBlock)2 CompilationException (org.apache.asterix.common.exceptions.CompilationException)1 Scope (org.apache.asterix.lang.common.context.Scope)1 VariableSubstitutionEnvironment (org.apache.asterix.lang.common.rewrites.VariableSubstitutionEnvironment)1 SetOpType (org.apache.asterix.lang.sqlpp.optype.SetOpType)1 Pair (org.apache.hyracks.algebricks.common.utils.Pair)1