@Override protected SqlNode visitScoped(SqlCall call) { switch (call.getKind()) { case SCALAR_QUERY: case CURRENT_VALUE: case NEXT_VALUE: case WITH: return call; } // Only visits arguments which are expressions. We don't want to // qualify non-expressions such as 'x' in 'empno * 5 AS x'. ArgHandler<SqlNode> argHandler = new CallCopyingArgHandler(call, false); call.getOperator().acceptCall(this, call, true, argHandler); final SqlNode result = argHandler.result(); validator.setOriginal(result, call); return result; } }
public <R> void acceptCall( SqlVisitor<R> visitor, SqlCall call, boolean onlyExpressions, SqlBasicVisitor.ArgHandler<R> argHandler) { if (!onlyExpressions) { // None of the arguments to the SELECT operator are expressions. super.acceptCall(visitor, call, onlyExpressions, argHandler); } }
public <R> void acceptCall( SqlVisitor<R> visitor, SqlCall call, boolean onlyExpressions, SqlBasicVisitor.ArgHandler<R> argHandler) { if (!onlyExpressions) { // None of the arguments to the SELECT operator are expressions. super.acceptCall(visitor, call, onlyExpressions, argHandler); } }
public R visit(SqlCall call) { return call.getOperator().acceptCall(this, call); }
public R visit(SqlCall call) { return call.getOperator().acceptCall(this, call); }
@Override public <R> void acceptCall( SqlVisitor<R> visitor, SqlCall call, boolean onlyExpressions, SqlBasicVisitor.ArgHandler<R> argHandler) { if (onlyExpressions) { List<SqlNode> operands = call.getOperandList(); for (int i = 0; i < operands.size(); i++) { SqlNode operand = operands.get(i); if (operand == null) { continue; } argHandler.visitChild(visitor, call, i, operand); } } else { super.acceptCall(visitor, call, onlyExpressions, argHandler); } }
@Override public <R> void acceptCall( SqlVisitor<R> visitor, SqlCall call, boolean onlyExpressions, SqlBasicVisitor.ArgHandler<R> argHandler) { if (onlyExpressions) { List<SqlNode> operands = call.getOperandList(); for (int i = 0; i < operands.size(); i++) { SqlNode operand = operands.get(i); if (operand == null) { continue; } argHandler.visitChild(visitor, call, i, operand); } } else { super.acceptCall(visitor, call, onlyExpressions, argHandler); } }
protected SqlNode visitScoped(SqlCall call) { ArgHandler<SqlNode> argHandler = new CallCopyingArgHandler(call, true); call.getOperator().acceptCall(this, call, false, argHandler); return argHandler.result(); }
@Override public SqlNode visit(final SqlCall call) { // Handler creates a new copy of 'call' only if one or more operands // change. ArgHandler<SqlNode> argHandler = new ComplexExpressionAware(call); call.getOperator().acceptCall(this, call, false, argHandler); return argHandler.result(); }
protected SqlNode visitScoped(SqlCall call) { ArgHandler<SqlNode> argHandler = new CallCopyingArgHandler(call, true); call.getOperator().acceptCall(this, call, false, argHandler); return argHandler.result(); }
public SqlNode visit(final SqlCall call) { // Handler creates a new copy of 'call' only if one or more operands // change. ArgHandler<SqlNode> argHandler = new CallCopyingArgHandler(call, false); call.getOperator().acceptCall(this, call, false, argHandler); return argHandler.result(); }
public SqlNode visit(final SqlCall call) { // Handler creates a new copy of 'call' only if one or more operands // change. ArgHandler<SqlNode> argHandler = new CallCopyingArgHandler(call, false); call.getOperator().acceptCall(this, call, false, argHandler); return argHandler.result(); }
public <R> void acceptCall( SqlVisitor<R> visitor, SqlCall call, boolean onlyExpressions, SqlBasicVisitor.ArgHandler<R> argHandler) { if (onlyExpressions) { for (Ord<SqlNode> operand : Ord.zip(call.getOperandList())) { // if the second param is an Identifier then it's supposed to // be a name from a window clause and isn't part of the // group by check if (operand.e == null) { continue; } if (operand.i == 1 && operand.e instanceof SqlIdentifier) { // skip refName continue; } argHandler.visitChild(visitor, call, operand.i, operand.e); } } else { super.acceptCall(visitor, call, onlyExpressions, argHandler); } }
public <R> void acceptCall( SqlVisitor<R> visitor, SqlCall call, boolean onlyExpressions, SqlBasicVisitor.ArgHandler<R> argHandler) { if (onlyExpressions) { for (Ord<SqlNode> operand : Ord.zip(call.getOperandList())) { // if the second param is an Identifier then it's supposed to // be a name from a window clause and isn't part of the // group by check if (operand.e == null) { continue; } if (operand.i == 1 && operand.e instanceof SqlIdentifier) { // skip refName continue; } argHandler.visitChild(visitor, call, operand.i, operand.e); } } else { super.acceptCall(visitor, call, onlyExpressions, argHandler); } }
@Override public SqlNode visit(final SqlCall call) { // Handler creates a new copy of 'call' only if one or more operands // change. ArgHandler<SqlNode> argHandler = new ComplexExpressionAware(call); boolean localEnableComplex = enableComplex; // for the case of UNNEST call set enableComplex to true // to convert DrillCompoundIdentifier to the item call. if (call.getKind() == SqlKind.UNNEST) { enableComplex = true; } call.getOperator().acceptCall(this, call, false, argHandler); enableComplex = localEnableComplex; return argHandler.result(); }
@Override protected SqlNode visitScoped(SqlCall call) { switch (call.getKind()) { case SCALAR_QUERY: case CURRENT_VALUE: case NEXT_VALUE: case WITH: return call; } // Only visits arguments which are expressions. We don't want to // qualify non-expressions such as 'x' in 'empno * 5 AS x'. ArgHandler<SqlNode> argHandler = new CallCopyingArgHandler(call, false); call.getOperator().acceptCall(this, call, true, argHandler); final SqlNode result = argHandler.result(); validator.setOriginal(result, call); return result; }
@Override protected SqlNode visitScoped(SqlCall call) { switch (call.getKind()) { case SCALAR_QUERY: case CURRENT_VALUE: case NEXT_VALUE: case WITH: return call; } // Only visits arguments which are expressions. We don't want to // qualify non-expressions such as 'x' in 'empno * 5 AS x'. ArgHandler<SqlNode> argHandler = new CallCopyingArgHandler(call, false); call.getOperator().acceptCall(this, call, true, argHandler); final SqlNode result = argHandler.result(); validator.setOriginal(result, call); return result; }
@Override public Void visit(SqlCall call) { // ignore window aggregates and ranking functions (associated with OVER operator) if (call.getOperator().getKind() == SqlKind.OVER) { return null; } if (call.getOperator().isAggregator()) { list.add(call); return null; } // Don't traverse into sub-queries, even if they contain aggregate // functions. if (call instanceof SqlSelect) { return null; } return call.getOperator().acceptCall(this, call); } }
@Override public Void visit(SqlCall call) { // ignore window aggregates and ranking functions (associated with OVER operator) if (call.getOperator().getKind() == SqlKind.OVER) { return null; } if (call.getOperator().isAggregator()) { list.add(call); return null; } // Don't traverse into sub-queries, even if they contain aggregate // functions. if (call instanceof SqlSelect) { return null; } return call.getOperator().acceptCall(this, call); } }
@Override public Void visit(SqlCall call) { // ignore window aggregates and ranking functions (associated with OVER operator) if (call.getOperator().getKind() == SqlKind.OVER) { return null; } if (call.getOperator().getKind() == SqlKind.FILTER) { // the WHERE in a FILTER must be tracked too so we can call replaceSubQueries on it. // see https://issues.apache.org/jira/browse/CALCITE-1910 final SqlNode aggCall = call.getOperandList().get(0); final SqlNode whereCall = call.getOperandList().get(1); list.add(aggCall); filterList.add(whereCall); return null; } if (call.getOperator().isAggregator()) { list.add(call); return null; } // Don't traverse into sub-queries, even if they contain aggregate // functions. if (call instanceof SqlSelect) { return null; } return call.getOperator().acceptCall(this, call); } }