當前位置: 首頁>>代碼示例>>Java>>正文


Java OuterJoinType.FULL屬性代碼示例

本文整理匯總了Java中com.espertech.esper.type.OuterJoinType.FULL屬性的典型用法代碼示例。如果您正苦於以下問題:Java OuterJoinType.FULL屬性的具體用法?Java OuterJoinType.FULL怎麽用?Java OuterJoinType.FULL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.espertech.esper.type.OuterJoinType的用法示例。


在下文中一共展示了OuterJoinType.FULL屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isFullOuterJoinAllStreams

private static boolean isFullOuterJoinAllStreams(StatementSpecCompiled statementSpec) {
    if (statementSpec.getOuterJoinDescList() == null || statementSpec.getOuterJoinDescList().length == 0) {
        return false;
    }
    for (int stream = 0; stream < statementSpec.getStreamSpecs().length - 1; stream++) {
        if (statementSpec.getOuterJoinDescList()[stream].getOuterJoinType() != OuterJoinType.FULL) {
            return false;
        }
    }
    return true;
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:11,代碼來源:EPStatementStartMethodSelectUtil.java

示例2: graphOuterJoins

/**
 * Builds a graph of outer joins given the outer join information from the statement.
 * Eliminates right and left joins and full joins by placing the information in a graph object.
 *
 * @param numStreams        - is the number of streams
 * @param outerJoinDescList - list of outer join stream numbers and property names
 * @return graph object
 */
protected static OuterInnerDirectionalGraph graphOuterJoins(int numStreams, OuterJoinDesc[] outerJoinDescList) {
    if ((outerJoinDescList.length + 1) != numStreams) {
        throw new IllegalArgumentException("Number of outer join descriptors and number of streams not matching up");
    }

    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;
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:66,代碼來源:NStreamOuterQueryPlanBuilder.java

示例3: graphOuterJoins

/**
 * Builds a graph of outer joins given the outer join information from the statement.
 * Eliminates right and left joins and full joins by placing the information in a graph object.
 * @param numStreams - is the number of streams
 * @param outerJoinDescList - list of outer join stream numbers and property names
 * @return graph object
 */
protected static OuterInnerDirectionalGraph graphOuterJoins(int numStreams, List<OuterJoinDesc> outerJoinDescList)
{
    if ((outerJoinDescList.size() + 1) != numStreams)
    {
        throw new IllegalArgumentException("Number of outer join descriptors and number of streams not matching up");
    }

    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;
}
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:80,代碼來源:NStreamOuterQueryPlanBuilder.java


注:本文中的com.espertech.esper.type.OuterJoinType.FULL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。