public static StreamRuntime parse(InputStream inputStream, Query query,
                                      Map<String, AbstractDefinition> streamDefinitionMap,
                                      Map<String, AbstractDefinition> tableDefinitionMap,
                                      Map<String, AbstractDefinition> windowDefinitionMap,
                                      Map<String, AbstractDefinition> aggregationDefinitionMap,
                                      Map<String, Table> tableMap,
                                      Map<String, Window> windowMap,
                                      Map<String, AggregationRuntime> aggregationMap,
                                      List<VariableExpressionExecutor> executors,
                                      boolean outputExpectsExpiredEvents,
                                      SiddhiQueryContext siddhiQueryContext) {

        if (inputStream instanceof BasicSingleInputStream || inputStream instanceof SingleInputStream) {
            SingleInputStream singleInputStream = (SingleInputStream) inputStream;
            ProcessStreamReceiver processStreamReceiver = new ProcessStreamReceiver(singleInputStream.getStreamId(),
                    siddhiQueryContext);
            return SingleInputStreamParser.parseInputStream((SingleInputStream) inputStream,
                    executors, streamDefinitionMap,
                    tableDefinitionMap, windowDefinitionMap, aggregationDefinitionMap, tableMap,
                    new MetaStreamEvent(), processStreamReceiver, true,
                    outputExpectsExpiredEvents, false, false, siddhiQueryContext);
        } else if (inputStream instanceof JoinInputStream) {
            return JoinInputStreamParser.parseInputStream(((JoinInputStream) inputStream),
                    query, streamDefinitionMap, tableDefinitionMap, windowDefinitionMap,
                    aggregationDefinitionMap, tableMap, windowMap, aggregationMap, executors,
                    outputExpectsExpiredEvents, siddhiQueryContext);
        } else if (inputStream instanceof StateInputStream) {
            MetaStateEvent metaStateEvent = new MetaStateEvent(inputStream.getAllStreamIds().size());
            return StateInputStreamParser.parseInputStream(((StateInputStream) inputStream),
                    metaStateEvent, streamDefinitionMap, tableDefinitionMap,
                    windowDefinitionMap, aggregationDefinitionMap, tableMap, executors,
                    siddhiQueryContext);
        } else {
            throw new OperationNotSupportedException();
        }
    }
Parse an InputStream returning corresponding StreamRuntime

@param inputStream                input stream to be parsed
@param streamDefinitionMap        map containing user given stream definitions
@param tableDefinitionMap         table definition map
@param windowDefinitionMap        window definition map
@param aggregationDefinitionMap   aggregation definition map
@param tableMap                   Table Map
@param windowMap                  event window map
@param aggregationMap             aggregator map
@param executors                  List to hold VariableExpressionExecutors to update after query parsing
@param outputExpectsExpiredEvents is expired events sent as output
@param siddhiQueryContext         Siddhi query context.
@return StreamRuntime
modules/siddhi-core/src/main/java/io/siddhi/core/util/parser/InputStreamParser.java