use of org.ballerinalang.siddhi.query.api.execution.query.input.stream.AnonymousInputStream in project ballerina by ballerina-lang.
the class SiddhiQLBaseVisitorImpl method visitAnonymous_stream.
/**
* {@inheritDoc}
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*
* @param ctx
*/
@Override
public AnonymousInputStream visitAnonymous_stream(@NotNull SiddhiQLParser.Anonymous_streamContext ctx) {
if (ctx.anonymous_stream() != null) {
return (AnonymousInputStream) visit(ctx.anonymous_stream());
}
Set<String> activeStreamsBackup = activeStreams;
try {
activeStreams = new HashSet<String>();
Query query = Query.query().from((InputStream) visit(ctx.query_input()));
if (ctx.query_section() != null) {
query.select((Selector) visit(ctx.query_section()));
}
if (ctx.output_rate() != null) {
query.output((OutputRate) visit(ctx.output_rate()));
}
if (ctx.output_event_type() != null) {
query.outStream(new ReturnStream((OutputStream.OutputEventType) visit(ctx.output_event_type())));
} else {
query.outStream(new ReturnStream());
}
AnonymousInputStream anonymousInputStream = new AnonymousInputStream(query);
populateQueryContext(anonymousInputStream, ctx);
return anonymousInputStream;
} finally {
activeStreams.clear();
activeStreams = activeStreamsBackup;
}
}
Aggregations