@Override
    protected CompiledSelection compileSelection(List<SelectAttributeBuilder> selectAttributeBuilders,
                                                 List<ExpressionBuilder> groupByExpressionBuilder,
                                                 ExpressionBuilder havingExpressionBuilder,
                                                 List<OrderByAttributeBuilder> orderByAttributeBuilders, Long limit,
                                                 Long offset) {
        CompiledSelectionWithCache compiledSelectionWithCache;
        MetaStateEvent metaStateEvent = matchingMetaInfoHolderForTestOnDemandQuery.getMetaStateEvent().clone();

        ReturnStream returnStream = new ReturnStream(OutputStream.OutputEventType.CURRENT_EVENTS);
        int metaPosition = SiddhiConstants.UNKNOWN_STATE;
        List<VariableExpressionExecutor> variableExpressionExecutorsForQuerySelector = new ArrayList<>();

        if (metaStateEvent.getOutputDataAttributes().size() == 0) {
            for (Attribute outputAttribute : metaStateEvent.getMetaStreamEvents()[0].getOnAfterWindowData()) {
                metaStateEvent.getMetaStreamEvents()[0].addOutputData(outputAttribute);
            }
        }

        QuerySelector querySelector = SelectorParser.parse(selectorForTestOnDemandQuery,
                returnStream,
                metaStateEvent, tableMap,
                variableExpressionExecutorsForQuerySelector, metaPosition, ProcessingMode.BATCH,
                false, siddhiQueryContextForTestOnDemandQuery);
        QueryParserHelper.updateVariablePosition(metaStateEvent,
                variableExpressionExecutorsForQuerySelector);
        querySelector.setEventPopulator(
                StateEventPopulatorFactory.constructEventPopulator(metaStateEvent));

        compiledSelectionWithCache = new CompiledSelectionWithCache(null, querySelector, metaStateEvent, 0, null);
        return compiledSelectionWithCache;
    }
Custom store for testing of in memory cache for store tables.
modules/siddhi-core/src/test/java/io/siddhi/core/query/table/util/TestStoreForCachePreLoading.java