@Override public Void visit(ConnectFeedStatement connectFeedStmt, Integer step) throws CompilationException { out.print(skip(step) + "connect " + FEED); out.print(generateFullName(connectFeedStmt.getDataverseName(), new Identifier(connectFeedStmt.getFeedName()))); out.print(" to " + datasetSymbol + generateFullName(connectFeedStmt.getDataverseName(), connectFeedStmt.getDatasetName())); if (connectFeedStmt.getPolicy() != null) { out.print(" using policy " + revertStringToQuoted(connectFeedStmt.getPolicy())); } if (connectFeedStmt.getAppliedFunctions() != null) { out.print(" apply function " + connectFeedStmt.getAppliedFunctions()); } out.println(SEMICOLON); return null; }
private void handleConnectFeedStatement(MetadataProvider metadataProvider, Statement stmt) throws Exception { FeedConnection fc; ConnectFeedStatement cfs = (ConnectFeedStatement) stmt; SourceLocation sourceLoc = cfs.getSourceLocation(); String dataverseName = getActiveDataverse(cfs.getDataverseName()); String feedName = cfs.getFeedName(); String datasetName = cfs.getDatasetName().getValue(); String policyName = cfs.getPolicy(); String whereClauseBody = cfs.getWhereClauseBody(); MetadataTransactionContext mdTxnCtx = MetadataManager.INSTANCE.beginTransaction(); metadataProvider.setMetadataTxnContext(mdTxnCtx); List<FunctionSignature> appliedFunctions = cfs.getAppliedFunctions(); for (FunctionSignature func : appliedFunctions) { if (MetadataManager.INSTANCE.getFunction(mdTxnCtx, func) == null) {
whereClauseBody = extractFragment(beginPos.endLine, beginPos.endColumn, endPos.endLine, endPos.endColumn + 1); stmt = new ConnectFeedStatement(feedNameComponents, datasetNameComponents, appliedFunctions, policy, whereClauseBody, getVarCounter()); {if (true) return addSourceLocation(stmt, startStmtToken);}
stmt = new ConnectFeedStatement(feedNameComponents, datasetNameComponents, appliedFunctions, policy, null, getVarCounter()); break; case DISCONNECT:
stmt = new ConnectFeedStatement(feedNameComponents, datasetNameComponents, appliedFunctions, policy, null, getVarCounter()); break; case DISCONNECT: