Examples of OuterJoinDesc


Examples of com.espertech.esper.epl.spec.OuterJoinDesc

        if (isAllHistoricalNoSubordinate)
        {
            boolean isOuterJoin = false;
            if (outerJoinDescList.length > 0)
            {
                OuterJoinDesc outerJoinDesc = outerJoinDescList[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;
                }
            }
View Full Code Here

Examples of com.espertech.esper.epl.spec.OuterJoinDesc

            }
        }

        for (int outerJoinCount = 0; outerJoinCount < statementSpec.getOuterJoinDescList().length; outerJoinCount++)
        {
            OuterJoinDesc outerJoinDesc = statementSpec.getOuterJoinDescList()[outerJoinCount];

            // validate on-expression nodes, if provided
            if (outerJoinDesc.getOptLeftNode() != null) {
                UniformPair<Integer> streamIdPair = validateOuterJoinPropertyPair(statementContext, outerJoinDesc.getOptLeftNode(), outerJoinDesc.getOptRightNode(), outerJoinCount,
                        typeService, viewResourceDelegate);

                if (outerJoinDesc.getAdditionalLeftNodes() != null)
                {
                    Set<Integer> streamSet = new HashSet<Integer>();
                    streamSet.add(streamIdPair.getFirst());
                    streamSet.add(streamIdPair.getSecond());
                    for (int i = 0; i < outerJoinDesc.getAdditionalLeftNodes().length; i++)
                    {
                        UniformPair<Integer> streamIdPairAdd = validateOuterJoinPropertyPair(statementContext, outerJoinDesc.getAdditionalLeftNodes()[i], outerJoinDesc.getAdditionalRightNodes()[i], outerJoinCount,
                                typeService, viewResourceDelegate);

                        // make sure all additional properties point to the same two streams
                        if ((!streamSet.contains(streamIdPairAdd.getFirst()) || (!streamSet.contains(streamIdPairAdd.getSecond()))))
                        {
View Full Code Here

Examples of com.espertech.esper.epl.spec.OuterJoinDesc

                if (isHistorical[toStream])
                {
                    // There may not be an outer-join descriptor, use if provided to build the associated expression
                    ExprNode outerJoinExpr = null;
                    if (outerJoinDescList.length > 0) {
                        OuterJoinDesc outerJoinDesc;
                        if (toStream == 0)
                        {
                            outerJoinDesc = outerJoinDescList[0];
                        }
                        else
                        {
                            outerJoinDesc = outerJoinDescList[toStream - 1];
                        }
                        outerJoinExpr = outerJoinDesc.makeExprNode(exprEvaluatorContext);
                    }

                    if (historicalStreamIndexLists[toStream] == null)
                    {
                        historicalStreamIndexLists[toStream] = new HistoricalStreamIndexList(toStream, typesPerStream, queryGraph);
View Full Code Here

Examples of com.espertech.esper.epl.spec.OuterJoinDesc

        OuterInnerDirectionalGraph graph = new OuterInnerDirectionalGraph(numStreams);

        for (int i = 0; i < outerJoinDescList.length; i++)
        {
            OuterJoinDesc desc = outerJoinDescList[i];
            int streamMax = i + 1;       // the outer join must references streams less then streamMax

            // Check outer join on-expression, if provided
            int streamOne;
            int streamTwo;
            int lowerStream;
            int higherStream;
            if (desc.getOptLeftNode() != null) {
                streamOne = desc.getOptLeftNode().getStreamId();
                streamTwo = desc.getOptRightNode().getStreamId();

                if ((streamOne > streamMax) || (streamTwo > streamMax) ||
                    (streamOne == streamTwo))
                {
                    throw new IllegalArgumentException("Outer join descriptors reference future streams, or same streams");
                }

                // Determine who is the first stream in the streams listed
                lowerStream = streamOne;
                higherStream = streamTwo;
                if (streamOne > streamTwo)
                {
                    lowerStream = streamTwo;
                    higherStream = streamOne;
                }
            }
            else {
                streamOne = i;
                streamTwo = i + 1;
                lowerStream = i;
                higherStream = i + 1;

                graph.addUnqualifiedNavigable(streamOne, streamTwo);
            }

            // Add to graph
            if (desc.getOuterJoinType() == OuterJoinType.FULL)
            {
                graph.add(streamOne, streamTwo);
                graph.add(streamTwo, streamOne);
            }
            else if (desc.getOuterJoinType() == OuterJoinType.LEFT)
            {
                graph.add(lowerStream, higherStream);
            }
            else if (desc.getOuterJoinType() == OuterJoinType.RIGHT)
            {
                graph.add(higherStream, lowerStream);
            }
            else if (desc.getOuterJoinType() == OuterJoinType.INNER)
            {
                // no navigability for inner joins
            }
            else
            {
                throw new IllegalArgumentException("Outer join descriptors join type not handled, type=" + desc.getOuterJoinType());
            }
        }

        return graph;
    }
View Full Code Here

Examples of com.espertech.esper.epl.spec.OuterJoinDesc

        if (isAllHistoricalNoSubordinate)
        {
            boolean isOuterJoin = false;
            if (outerJoinDescList.length > 0)
            {
                OuterJoinDesc outerJoinDesc = outerJoinDescList[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;
                }
            }
View Full Code Here

Examples of com.espertech.esper.epl.spec.OuterJoinDesc

        // Build an outer join expression node
        boolean isOuterJoin = false;
        ExprNode outerJoinEqualsNode = null;
        if (outerJoinDescList.length > 0)
        {
            OuterJoinDesc outerJoinDesc = outerJoinDescList[0];
            if (outerJoinDesc.getOuterJoinType().equals(OuterJoinType.FULL))
            {
                isOuterJoin = true;
            }
            else if ((outerJoinDesc.getOuterJoinType().equals(OuterJoinType.LEFT)) &&
                    (streamViewNum == 0))
            {
                    isOuterJoin = true;
            }
            else if ((outerJoinDesc.getOuterJoinType().equals(OuterJoinType.RIGHT)) &&
                    (streamViewNum == 1))
            {
                    isOuterJoin = true;
            }

            outerJoinEqualsNode  = outerJoinDesc.makeExprNode(exprEvaluatorContext);
        }

        // Determine filter for indexing purposes
        ExprNode filterForIndexing = null;
        if ((outerJoinEqualsNode != null) && (optionalFilterNode != null))  // both filter and outer join, add
View Full Code Here

Examples of com.espertech.esper.epl.spec.OuterJoinDesc

        Set<InterchangeablePair<Integer, Integer>> graph = new HashSet<InterchangeablePair<Integer, Integer>>();

        boolean allInnerJoin = true;
        for (int i = 0; i < outerJoinDescList.length; i++)
        {
            OuterJoinDesc desc = outerJoinDescList[i];
            int streamMax = i + 1;       // the outer join must references streams less then streamMax

            // Check outer join on-expression, if provided
            if (desc.getOptLeftNode() != null) {
                int streamOne = desc.getOptLeftNode().getStreamId();
                int streamTwo = desc.getOptRightNode().getStreamId();

                if ((streamOne > streamMax) || (streamTwo > streamMax) ||
                    (streamOne == streamTwo))
                {
                    throw new IllegalArgumentException("Outer join descriptors reference future streams, or same streams");
                }

                if (desc.getOuterJoinType() == OuterJoinType.INNER)
                {
                    graph.add(new InterchangeablePair<Integer, Integer>(streamOne, streamTwo));
                }
            }

            if (desc.getOuterJoinType() != OuterJoinType.INNER)
            {
                allInnerJoin = false;
            }
        }
View Full Code Here

Examples of com.espertech.esper.epl.spec.OuterJoinDesc

            }
        }

        for (int outerJoinCount = 0; outerJoinCount < statementSpec.getOuterJoinDescList().length; outerJoinCount++)
        {
            OuterJoinDesc outerJoinDesc = statementSpec.getOuterJoinDescList()[outerJoinCount];

            // validate on-expression nodes, if provided
            if (outerJoinDesc.getOptLeftNode() != null) {
                UniformPair<Integer> streamIdPair = validateOuterJoinPropertyPair(statementContext, outerJoinDesc.getOptLeftNode(), outerJoinDesc.getOptRightNode(), outerJoinCount,
                        typeService, viewResourceDelegate);

                if (outerJoinDesc.getAdditionalLeftNodes() != null)
                {
                    Set<Integer> streamSet = new HashSet<Integer>();
                    streamSet.add(streamIdPair.getFirst());
                    streamSet.add(streamIdPair.getSecond());
                    for (int i = 0; i < outerJoinDesc.getAdditionalLeftNodes().length; i++)
                    {
                        UniformPair<Integer> streamIdPairAdd = validateOuterJoinPropertyPair(statementContext, outerJoinDesc.getAdditionalLeftNodes()[i], outerJoinDesc.getAdditionalRightNodes()[i], outerJoinCount,
                                typeService, viewResourceDelegate);

                        // make sure all additional properties point to the same two streams
                        if ((!streamSet.contains(streamIdPairAdd.getFirst()) || (!streamSet.contains(streamIdPairAdd.getSecond()))))
                        {
View Full Code Here

Examples of com.espertech.esper.epl.spec.OuterJoinDesc

                if (isHistorical[toStream])
                {
                    // There may not be an outer-join descriptor, use if provided to build the associated expression
                    ExprNode outerJoinExpr = null;
                    if (!outerJoinDescList.isEmpty()) {
                        OuterJoinDesc outerJoinDesc;
                        if (toStream == 0)
                        {
                            outerJoinDesc = outerJoinDescList.get(0);
                        }
                        else
                        {
                            outerJoinDesc = outerJoinDescList.get(toStream - 1);
                        }
                        outerJoinExpr = outerJoinDesc.makeExprNode(exprEvaluatorContext);
                    }

                    if (historicalStreamIndexLists[toStream] == null)
                    {
                        historicalStreamIndexLists[toStream] = new HistoricalStreamIndexList(toStream, typesPerStream, queryGraph);
View Full Code Here

Examples of com.espertech.esper.epl.spec.OuterJoinDesc

        OuterInnerDirectionalGraph graph = new OuterInnerDirectionalGraph(numStreams);

        for (int i = 0; i < outerJoinDescList.size(); i++)
        {
            OuterJoinDesc desc = outerJoinDescList.get(i);
            int streamMax = i + 1;       // the outer join must references streams less then streamMax

            // Check outer join on-expression, if provided
            int streamOne;
            int streamTwo;
            int lowerStream;
            int higherStream;
            if (desc.getOptLeftNode() != null) {
                streamOne = desc.getOptLeftNode().getStreamId();
                streamTwo = desc.getOptRightNode().getStreamId();

                if ((streamOne > streamMax) || (streamTwo > streamMax) ||
                    (streamOne == streamTwo))
                {
                    throw new IllegalArgumentException("Outer join descriptors reference future streams, or same streams");
                }

                // Determine who is the first stream in the streams listed
                lowerStream = streamOne;
                higherStream = streamTwo;
                if (streamOne > streamTwo)
                {
                    lowerStream = streamTwo;
                    higherStream = streamOne;
                }
            }
            else {
                streamOne = i;
                streamTwo = i + 1;
                lowerStream = i;
                higherStream = i + 1;

                graph.addUnqualifiedNavigable(streamOne, streamTwo);
            }

            // Add to graph
            if (desc.getOuterJoinType() == OuterJoinType.FULL)
            {
                graph.add(streamOne, streamTwo);
                graph.add(streamTwo, streamOne);
            }
            else if (desc.getOuterJoinType() == OuterJoinType.LEFT)
            {
                graph.add(lowerStream, higherStream);
            }
            else if (desc.getOuterJoinType() == OuterJoinType.RIGHT)
            {
                graph.add(higherStream, lowerStream);
            }
            else if (desc.getOuterJoinType() == OuterJoinType.INNER)
            {
                // no navigability for inner joins
            }
            else
            {
                throw new IllegalArgumentException("Outer join descriptors join type not handled, type=" + desc.getOuterJoinType());
            }
        }

        return graph;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.