@Override public Void visit(CreateFeedStatement cfs, Integer step) throws CompilationException { out.print(skip(step) + "create " + FEED); out.print(generateFullName(cfs.getDataverseName(), cfs.getFeedName())); out.print(generateIfNotExists(cfs.getIfNotExists())); if (cfs.getWithObjectNode() != null) { out.print(" with "); out.print(cfs.getWithObjectNode().toString()); } out.println(SEMICOLON); return null; }
protected void handleCreateFeedStatement(MetadataProvider metadataProvider, Statement stmt) throws Exception { CreateFeedStatement cfs = (CreateFeedStatement) stmt; SourceLocation sourceLoc = cfs.getSourceLocation(); String dataverseName = getActiveDataverse(cfs.getDataverseName()); String feedName = cfs.getFeedName().getValue(); MetadataTransactionContext mdTxnCtx = MetadataManager.INSTANCE.beginTransaction(); metadataProvider.setMetadataTxnContext(mdTxnCtx); MetadataManager.INSTANCE.getFeed(metadataProvider.getMetadataTxnContext(), dataverseName, feedName); if (feed != null) { if (cfs.getIfNotExists()) { MetadataManager.INSTANCE.commitTransaction(mdTxnCtx); return; feed = new Feed(dataverseName, feedName, cfs.getConfiguration()); FeedMetadataUtil.validateFeed(feed, mdTxnCtx, appCtx); MetadataManager.INSTANCE.addFeed(metadataProvider.getMetadataTxnContext(), feed);
final public CreateFeedStatement FeedSpecification() throws ParseException, ParseException { Pair<Identifier,Identifier> nameComponents = null; boolean ifNotExists = false; CreateFeedStatement cfs = null; Pair<Identifier,Identifier> sourceNameComponents = null; RecordConstructor withRecord = null; jj_consume_token(FEED); nameComponents = QualifiedName(); ifNotExists = IfNotExists(); jj_consume_token(WITH); withRecord = RecordConstructor(); try { cfs = new CreateFeedStatement(nameComponents, withRecord, ifNotExists); {if (true) return cfs;} } catch (AlgebricksException e) { {if (true) throw new ParseException(e.getMessage());} } throw new Error("Missing return statement in function"); }
final public CreateFeedStatement FeedSpecification() throws ParseException, ParseException { Pair<Identifier,Identifier> nameComponents = null; boolean ifNotExists = false; CreateFeedStatement cfs = null; Pair<Identifier,Identifier> sourceNameComponents = null; RecordConstructor withRecord = null; jj_consume_token(FEED); nameComponents = QualifiedName(); ifNotExists = IfNotExists(); jj_consume_token(WITH); withRecord = RecordConstructor(); try { cfs = new CreateFeedStatement(nameComponents, withRecord, ifNotExists); {if (true) return cfs;} } catch (AlgebricksException e) { {if (true) throw new ParseException(e.getMessage());} } throw new Error("Missing return statement in function"); }
final public CreateFeedStatement FeedSpecification(Token startStmtToken) throws ParseException, ParseException { Pair<Identifier,Identifier> nameComponents = null; boolean ifNotExists = false; String adapterName = null; Map<String,String> properties = null; CreateFeedStatement stmt = null; Pair<Identifier,Identifier> sourceNameComponents = null; RecordConstructor withRecord = null; jj_consume_token(FEED); nameComponents = QualifiedName(); ifNotExists = IfNotExists(); jj_consume_token(WITH); withRecord = RecordConstructor(); try { stmt = new CreateFeedStatement(nameComponents, withRecord, ifNotExists); {if (true) return addSourceLocation(stmt, startStmtToken);} } catch (AlgebricksException e) { {if (true) throw new SqlppParseException(getSourceLocation(startStmtToken), e.getMessage());} } throw new Error("Missing return statement in function"); }