private void registerMatchRecognize( SqlValidatorScope parentScope, SqlValidatorScope usingScope, SqlMatchRecognize call, SqlNode enclosingNode, String alias, boolean forceNullable) { final MatchRecognizeNamespace matchRecognizeNamespace = createMatchRecognizeNameSpace(call, enclosingNode); registerNamespace(usingScope, alias, matchRecognizeNamespace, forceNullable); final MatchRecognizeScope matchRecognizeScope = new MatchRecognizeScope(parentScope, call); scopes.put(call, matchRecognizeScope); // parse input query SqlNode expr = call.getTableRef(); SqlNode newExpr = registerFrom(usingScope, matchRecognizeScope, true, expr, expr, null, null, forceNullable, false); if (expr != newExpr) { call.setOperand(0, newExpr); } }
List<SqlNode> operands = ((SqlCall) node).getOperandList(); String leftString = ((SqlIdentifier) operands.get(0)).getSimple(); if (scope.getPatternVars().contains(leftString)) { throw newValidationError(operands.get(0), RESOURCE.patternVarAlreadyDefined(leftString)); scope.addPatternVar(leftString); for (SqlNode right : (SqlNodeList) operands.get(1)) { SqlIdentifier id = (SqlIdentifier) right; if (!scope.getPatternVars().contains(id.getSimple())) { throw newValidationError(id, RESOURCE.unknownPattern(id.getSimple())); scope.addPatternVar(id.getSimple()); final SqlCall skipToCall = (SqlCall) skipTo; final SqlIdentifier id = skipToCall.operand(0); if (!scope.getPatternVars().contains(id.getSimple())) { throw newValidationError(id, RESOURCE.unknownPattern(id.getSimple()));
@Override public Void visit(SqlIdentifier id) { Preconditions.checkArgument(id.isSimple()); scope.addPatternVar(id.getSimple()); return null; }
Static.RESOURCE.patternVarAlreadyDefined(alias)); scope.addPatternVar(alias);
List<SqlNode> operands = ((SqlCall) node).getOperandList(); String leftString = ((SqlIdentifier) operands.get(0)).getSimple(); if (scope.getPatternVars().contains(leftString)) { throw newValidationError(operands.get(0), RESOURCE.patternVarAlreadyDefined(leftString)); scope.addPatternVar(leftString); for (SqlNode right : (SqlNodeList) operands.get(1)) { SqlIdentifier id = (SqlIdentifier) right; if (!scope.getPatternVars().contains(id.getSimple())) { throw newValidationError(id, RESOURCE.unknownPattern(id.getSimple())); scope.addPatternVar(id.getSimple()); final SqlCall skipToCall = (SqlCall) skipTo; final SqlIdentifier id = skipToCall.operand(0); if (!scope.getPatternVars().contains(id.getSimple())) { throw newValidationError(id, RESOURCE.unknownPattern(id.getSimple()));
@Override public Void visit(SqlIdentifier id) { Preconditions.checkArgument(id.isSimple()); scope.addPatternVar(id.getSimple()); return null; }
private void registerMatchRecognize( SqlValidatorScope parentScope, SqlValidatorScope usingScope, SqlMatchRecognize call, SqlNode enclosingNode, String alias, boolean forceNullable) { final MatchRecognizeNamespace matchRecognizeNamespace = createMatchRecognizeNameSpace(call, enclosingNode); registerNamespace(usingScope, alias, matchRecognizeNamespace, forceNullable); final MatchRecognizeScope matchRecognizeScope = new MatchRecognizeScope(parentScope, call); scopes.put(call, matchRecognizeScope); // parse input query SqlNode expr = call.getTableRef(); SqlNode newExpr = registerFrom(usingScope, matchRecognizeScope, true, expr, expr, null, null, forceNullable, false); if (expr != newExpr) { call.setOperand(0, newExpr); } }
List<SqlNode> operands = ((SqlCall) node).getOperandList(); String leftString = ((SqlIdentifier) operands.get(0)).getSimple(); if (scope.getPatternVars().contains(leftString)) { throw newValidationError(operands.get(0), RESOURCE.patternVarAlreadyDefined(leftString)); scope.addPatternVar(leftString); for (SqlNode right : (SqlNodeList) operands.get(1)) { SqlIdentifier id = (SqlIdentifier) right; if (!scope.getPatternVars().contains(id.getSimple())) { throw newValidationError(id, RESOURCE.unknownPattern(id.getSimple())); scope.addPatternVar(id.getSimple()); final SqlCall skipToCall = (SqlCall) skipTo; final SqlIdentifier id = skipToCall.operand(0); if (!scope.getPatternVars().contains(id.getSimple())) { throw newValidationError(id, RESOURCE.unknownPattern(id.getSimple()));
@Override public Void visit(SqlIdentifier id) { Preconditions.checkArgument(id.isSimple()); scope.addPatternVar(id.getSimple()); return null; }
private void registerMatchRecognize( SqlValidatorScope parentScope, SqlValidatorScope usingScope, SqlMatchRecognize call, SqlNode enclosingNode, String alias, boolean forceNullable) { final MatchRecognizeNamespace matchRecognizeNamespace = createMatchRecognizeNameSpace(call, enclosingNode); registerNamespace(usingScope, alias, matchRecognizeNamespace, forceNullable); final MatchRecognizeScope matchRecognizeScope = new MatchRecognizeScope(parentScope, call); scopes.put(call, matchRecognizeScope); // parse input query SqlNode expr = call.getTableRef(); SqlNode newExpr = registerFrom(usingScope, matchRecognizeScope, true, expr, expr, null, null, forceNullable, false); if (expr != newExpr) { call.setOperand(0, newExpr); } }
Static.RESOURCE.patternVarAlreadyDefined(alias)); scope.addPatternVar(alias);
Static.RESOURCE.patternVarAlreadyDefined(alias)); scope.addPatternVar(alias);