private static OnDemandQueryRuntime getOnDemandQueryRuntime(OnDemandQuery onDemandQuery,
                                                                Map<String, Table> tableMap,
                                                                Map<String, Window> windowMap,
                                                                int metaPosition, LockWrapper lockWrapper,
                                                                MetaStreamEvent metaStreamEvent,
                                                                OutputStream outputStream, Expression onCondition,
                                                                SiddhiQueryContext siddhiQueryContext) {
        try {
            List<VariableExpressionExecutor> variableExpressionExecutors = new ArrayList<>();
            Table table = tableMap.get(outputStream.getId());

            if (table != null) {
                return constructOnDemandQueryRuntime(table, onDemandQuery, tableMap, windowMap,
                        metaPosition, onCondition, metaStreamEvent,
                        variableExpressionExecutors, lockWrapper, siddhiQueryContext);
            } else {
                throw new OnDemandQueryCreationException(outputStream.getId() + " is not a table.");
            }

        } finally {
            SnapshotService.getSkipStateStorageThreadLocal().set(null);
        }
    }
Parse a onDemandQuery and return corresponding OnDemandQueryRuntime.

@param onDemandQuery       onDemandQuery to be parsed.
@param siddhiQueryContext associated Siddhi query context.
@param tableMap         keyvalue containing tables.
@param windowMap        keyvalue containing windows.
@param aggregationMap   keyvalue containing aggregation runtimes.
@return OnDemandQueryRuntime
modules/siddhi-core/src/main/java/io/siddhi/core/util/parser/OnDemandQueryParser.java