Search in sources :

Example 1 with InputStream

use of io.siddhi.query.api.execution.query.input.stream.InputStream in project siddhi by wso2.

the class SiddhiQLBaseVisitorImpl method visitJoin_stream.

/**
 * {@inheritDoc}
 * <p>The default implementation returns the result of calling
 * {@link #visitChildren} on {@code ctx}.</p>
 *
 * @param ctx
 */
@Override
public Object visitJoin_stream(@NotNull SiddhiQLParser.Join_streamContext ctx) {
    // join_stream
    // :left_source=join_source join right_source=join_source right_unidirectional=UNIDIRECTIONAL (ON expression)?
    // 
    // |left_source=join_source join right_source=join_source (ON expression)?
    // |left_source=join_source left_unidirectional=UNIDIRECTIONAL join right_source=join_source (ON expression)?
    // 
    // ;
    SingleInputStream leftStream = (SingleInputStream) visit(ctx.left_source);
    SingleInputStream rightStream = (SingleInputStream) visit(ctx.right_source);
    JoinInputStream.Type joinType = (JoinInputStream.Type) visit(ctx.join());
    JoinInputStream.EventTrigger eventTrigger = null;
    Expression onCondition = null;
    Within within = null;
    Expression per = null;
    if (ctx.within_time_range() != null) {
        within = (Within) visit(ctx.within_time_range());
    }
    if (ctx.per() != null) {
        per = (Expression) visit(ctx.per());
    }
    if (ctx.expression() != null) {
        onCondition = (Expression) visit(ctx.expression());
    }
    if (ctx.right_unidirectional != null) {
        eventTrigger = JoinInputStream.EventTrigger.RIGHT;
    } else if (ctx.left_unidirectional != null) {
        eventTrigger = JoinInputStream.EventTrigger.LEFT;
    } else {
        eventTrigger = JoinInputStream.EventTrigger.ALL;
    }
    InputStream inputStream = InputStream.joinStream(leftStream, joinType, rightStream, onCondition, eventTrigger, within, per);
    populateQueryContext(inputStream, ctx);
    return inputStream;
}
Also used : ValuePartitionType(io.siddhi.query.api.execution.partition.ValuePartitionType) PartitionType(io.siddhi.query.api.execution.partition.PartitionType) RangePartitionType(io.siddhi.query.api.execution.partition.RangePartitionType) Expression(io.siddhi.query.api.expression.Expression) SingleInputStream(io.siddhi.query.api.execution.query.input.stream.SingleInputStream) BasicSingleInputStream(io.siddhi.query.api.execution.query.input.stream.BasicSingleInputStream) JoinInputStream(io.siddhi.query.api.execution.query.input.stream.JoinInputStream) StateInputStream(io.siddhi.query.api.execution.query.input.stream.StateInputStream) JoinInputStream(io.siddhi.query.api.execution.query.input.stream.JoinInputStream) SingleInputStream(io.siddhi.query.api.execution.query.input.stream.SingleInputStream) AnonymousInputStream(io.siddhi.query.api.execution.query.input.stream.AnonymousInputStream) InputStream(io.siddhi.query.api.execution.query.input.stream.InputStream) BasicSingleInputStream(io.siddhi.query.api.execution.query.input.stream.BasicSingleInputStream) Within(io.siddhi.query.api.aggregation.Within)

Aggregations

Within (io.siddhi.query.api.aggregation.Within)1 PartitionType (io.siddhi.query.api.execution.partition.PartitionType)1 RangePartitionType (io.siddhi.query.api.execution.partition.RangePartitionType)1 ValuePartitionType (io.siddhi.query.api.execution.partition.ValuePartitionType)1 AnonymousInputStream (io.siddhi.query.api.execution.query.input.stream.AnonymousInputStream)1 BasicSingleInputStream (io.siddhi.query.api.execution.query.input.stream.BasicSingleInputStream)1 InputStream (io.siddhi.query.api.execution.query.input.stream.InputStream)1 JoinInputStream (io.siddhi.query.api.execution.query.input.stream.JoinInputStream)1 SingleInputStream (io.siddhi.query.api.execution.query.input.stream.SingleInputStream)1 StateInputStream (io.siddhi.query.api.execution.query.input.stream.StateInputStream)1 Expression (io.siddhi.query.api.expression.Expression)1