@Override public SqlNode visit(SqlCall call) { SqlKind kind = call.getKind(); if (isLogicalNavigation(kind) || isAggregation(kind) || isRunningOrFinal(kind)) { return call; } switch (kind) { case PREV: final List<SqlNode> operands = call.getOperandList(); if (operands.get(0) instanceof SqlIdentifier) { String name = ((SqlIdentifier) operands.get(0)).names.get(0); return name.equals(alpha) ? call : SqlStdOperatorTable.LAST.createCall(SqlParserPos.ZERO, operands); } } return super.visit(call); }
@Override public SqlRexConvertlet get(SqlCall call) { if (call.getKind() == SqlKind.EXTRACT && call.getOperandList().get(1).getKind() != SqlKind.LITERAL) { // Avoid using the standard convertlet for EXTRACT(TIMEUNIT FROM col), since we want to handle it directly // in ExtractOperationConversion. return BYPASS_CONVERTLET; } else { final SqlRexConvertlet convertlet = table.get(call.getOperator()); return convertlet != null ? convertlet : StandardConvertletTable.INSTANCE.get(call); } }
@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 boolean isAggregate(SqlSelect select) { if (getAggregate(select) != null) { return true; } // Also when nested window aggregates are present for (SqlCall call : overFinder.findAll(select.getSelectList())) { assert call.getKind() == SqlKind.OVER; if (isNestedAggregateWindow(call.operand(0))) { return true; } if (isOverAggregateWindow(call.operand(1))) { return true; } } return false; }
@Override public SqlNode visit(SqlCall call) { SqlKind kind = call.getKind(); List<SqlNode> operands = call.getOperandList(); List<SqlNode> newOperands = new ArrayList<>();
@Override public Set<String> visit(SqlCall call) { boolean isSingle = false; Set<String> vars = new HashSet<>(); SqlKind kind = call.getKind(); List<SqlNode> operands = call.getOperandList();
RelDataType targetRowType, final SqlValidatorScope scope) { assert node.getKind() == SqlKind.VALUES;
final SqlKind kind = call.getKind(); final List<SqlNode> operands = call.getOperandList(); for (int i = 0; i < operands.size(); i++) {
if (call.getKind() == SqlKind.MINUS && call.operandCount() == 2) { List<SqlNode> list3 = startList(call.operand(0));
if (call.getKind() == SqlKind.MINUS && call.operandCount() == 2) { List<SqlNode> list3 = startList(call.operand(0));
@Override public Void visit(SqlCall call) { if (call.getKind() == SqlKind.OVER) { throw FoundOne.NULL; } return super.visit(call); } }
@Override public Void visit(SqlCall call) { if (call.getKind() == SqlKind.OVER) { throw FoundOne.NULL; } return super.visit(call); } }
public Boolean visit(SqlCall call) { if (!isWhitelisted(call.getKind())) { return false; } return super.visit(call); } };
if (call.getKind() == SqlKind.MINUS && call.operandCount() == 2) { List<SqlNode> list3 = startList(call.operand(0));
private boolean isCountDistinct(SqlCall call) { return call.getKind() == SqlKind.COUNT && call.getFunctionQuantifier() != null && call.getFunctionQuantifier().getValue() == SqlSelectKeyword.DISTINCT; }
private boolean isCountDistinct(SqlCall call) { return call.getKind() == SqlKind.COUNT && call.getFunctionQuantifier() != null && call.getFunctionQuantifier().getValue() == SqlSelectKeyword.DISTINCT; }
@Override public boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, SqlNode parent, CalciteConnectionConfig config) { // For testing return call.getKind() != SqlKind.MAX && (parent.getKind() == SqlKind.SELECT || parent.getKind() == SqlKind.FILTER); }
@Override public boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, SqlNode parent, CalciteConnectionConfig config) { // For testing return call.getKind() != SqlKind.MAX && (parent.getKind() == SqlKind.SELECT || parent.getKind() == SqlKind.FILTER); }