public JoinSetComposerDesc create(Viewable[] streamViews) {
QueryStrategy[] queryStrategies = new QueryStrategy[streamTypes.length];
HistoricalEventViewable viewable = (HistoricalEventViewable) streamViews[polledViewNum];
ExprEvaluator outerJoinEqualsNodeEval = outerJoinEqualsNode == null ? null : outerJoinEqualsNode.getExprEvaluator();
queryStrategies[streamViewNum] = new HistoricalDataQueryStrategy(streamViewNum, polledViewNum, viewable, isOuterJoin, outerJoinEqualsNodeEval,
indexStrategies.getFirst(), indexStrategies.getSecond());
// for strictly historical joins, create a query strategy for the non-subordinate historical view
if (isAllHistoricalNoSubordinate)
{
boolean isOuterJoin = false;
if (!outerJoinDescList.isEmpty())
{
OuterJoinDesc outerJoinDesc = outerJoinDescList.get(0);
if (outerJoinDesc.getOuterJoinType().equals(OuterJoinType.FULL))
{
isOuterJoin = true;
}
else if ((outerJoinDesc.getOuterJoinType().equals(OuterJoinType.LEFT)) &&
(polledViewNum == 0))
{
isOuterJoin = true;
}
else if ((outerJoinDesc.getOuterJoinType().equals(OuterJoinType.RIGHT)) &&
(polledViewNum == 1))
{
isOuterJoin = true;
}
}
viewable = (HistoricalEventViewable) streamViews[streamViewNum];
queryStrategies[polledViewNum] = new HistoricalDataQueryStrategy(polledViewNum, streamViewNum, viewable, isOuterJoin, outerJoinEqualsNodeEval,
new HistoricalIndexLookupStrategyNoIndex(), new PollResultIndexingStrategyNoIndex());
}
JoinSetComposer composer = new JoinSetComposerHistoricalImpl(null, queryStrategies, streamViews, exprEvaluatorContext);
ExprEvaluator postJoinEval = optionalFilterNode == null ? null : optionalFilterNode.getExprEvaluator();
return new JoinSetComposerDesc(composer, postJoinEval);
}