Package com.espertech.esper.epl.expression

Examples of com.espertech.esper.epl.expression.ExprIdentNode


            }

            if (otherPropertyNum != -1)
            {
                if (otherStrictKeyProps[otherPropertyNum] != null) {
                    ExprIdentNode identNodeLookup = new ExprIdentNodeImpl(typesPerStream[lookupStream], keyProp, lookupStream);
                    ExprIdentNode identNodeOther = new ExprIdentNodeImpl(typesPerStream[otherStream], otherStrictKeyProps[otherPropertyNum], otherStream);
                    boolean added = queryGraph.addStrictEquals(lookupStream, keyProp, identNodeLookup, otherStream, otherStrictKeyProps[otherPropertyNum], identNodeOther);
                    if (added)
                    {
                        addedEquivalency = true;
                    }
View Full Code Here


            }

            if (otherPropertyNum != -1)
            {
                if (otherStrictKeyProps[otherPropertyNum] != null) {
                    ExprIdentNode identNodeLookup = new ExprIdentNodeImpl(typesPerStream[lookupStream], keyProp, lookupStream);
                    ExprIdentNode identNodeOther = new ExprIdentNodeImpl(typesPerStream[otherStream], otherStrictKeyProps[otherPropertyNum], otherStream);
                    boolean added = queryGraph.addStrictEquals(lookupStream, keyProp, identNodeLookup, otherStream, otherStrictKeyProps[otherPropertyNum], identNodeOther);
                    if (added)
                    {
                        addedEquivalency = true;
                    }
View Full Code Here

    {
      if(!node.getChildNodes().isEmpty())
      {
        throw new IllegalStateException("Ident node has unexpected child nodes");
      }
            ExprIdentNode identNode = (ExprIdentNode) node;
      return identNode.getUnresolvedPropertyName().equals(name) && identNode.getStreamOrPropertyName() == null;
    }
    else
    {
      return false;
    }
View Full Code Here

    {
        for (OuterJoinDesc outerJoinDesc : outerJoinDescList)
        {
            // add optional on-expressions
            if (outerJoinDesc.getOptLeftNode() != null) {
                ExprIdentNode identNodeLeft = outerJoinDesc.getOptLeftNode();
                ExprIdentNode identNodeRight = outerJoinDesc.getOptRightNode();

                add(queryGraph, identNodeLeft, identNodeRight);

                if (outerJoinDesc.getAdditionalLeftNodes() != null)
                {
View Full Code Here

        if (targetStreamNum == parameterStreamNum) {
            return;
        }

        ExprIdentNode targetStartExpr = getExprNode(typesPerStream, targetStreamNum, targetStartProp);
        ExprIdentNode targetEndExpr = getExprNode(typesPerStream, targetStreamNum, targetEndProp);
        ExprIdentNode parameterStartExpr = getExprNode(typesPerStream, parameterStreamNum, parameterStartProp);
        ExprIdentNode parameterEndExpr = getExprNode(typesPerStream, parameterStreamNum, parameterEndProp);

        if (targetStartExpr.getExprEvaluator().getType() != parameterStartExpr.getExprEvaluator().getType()) {
            return;
        }

        if (currentMethod == DatetimeMethodEnum.BEFORE) {
            // a.end < b.start
            queryGraph.addRelationalOpStrict(targetStreamNum, targetEndProp, targetEndExpr,
                    parameterStreamNum, parameterStartProp, parameterStartExpr,
                    RelationalOpEnum.LT);
        }
        else if (currentMethod == DatetimeMethodEnum.AFTER) {
            // a.start > b.end
            queryGraph.addRelationalOpStrict(targetStreamNum, targetStartProp, targetStartExpr,
                    parameterStreamNum, parameterEndProp, parameterEndExpr,
                    RelationalOpEnum.GT);
        }
        else if (currentMethod == DatetimeMethodEnum.COINCIDES) {
            // a.startTimestamp = b.startTimestamp and a.endTimestamp = b.endTimestamp
            queryGraph.addStrictEquals(targetStreamNum, targetStartProp, targetStartExpr,
                    parameterStreamNum, parameterStartProp, parameterStartExpr);

            boolean noDuration = parameterEndProp.equals(parameterStartProp) && targetEndProp.equals(targetStartProp);
            if (!noDuration) {
                ExprIdentNode leftEndExpr = getExprNode(typesPerStream, targetStreamNum, targetEndProp);
                ExprIdentNode rightEndExpr = getExprNode(typesPerStream, parameterStreamNum, parameterEndProp);
                queryGraph.addStrictEquals(targetStreamNum, targetEndProp, leftEndExpr,
                        parameterStreamNum, parameterEndProp, rightEndExpr);
            }
        }
        else if (currentMethod == DatetimeMethodEnum.DURING || currentMethod == DatetimeMethodEnum.INCLUDES) {
View Full Code Here

            }

            if (otherPropertyNum != -1)
            {
                if (otherStrictKeyProps[otherPropertyNum] != null) {
                    ExprIdentNode identNodeLookup = new ExprIdentNodeImpl(typesPerStream[lookupStream], keyProp, lookupStream);
                    ExprIdentNode identNodeOther = new ExprIdentNodeImpl(typesPerStream[otherStream], otherStrictKeyProps[otherPropertyNum], otherStream);
                    boolean added = queryGraph.addStrictEquals(lookupStream, keyProp, identNodeLookup, otherStream, otherStrictKeyProps[otherPropertyNum], identNodeOther);
                    if (added)
                    {
                        addedEquivalency = true;
                    }
View Full Code Here

     */
    public static QueryGraph analyze(List<OuterJoinDesc> outerJoinDescList, QueryGraph queryGraph)
    {
        for (OuterJoinDesc outerJoinDesc : outerJoinDescList)
        {
            ExprIdentNode identNodeLeft = outerJoinDesc.getLeftNode();
            ExprIdentNode identNodeRight = outerJoinDesc.getRightNode();

            add(queryGraph, identNodeLeft, identNodeRight);

            if (outerJoinDesc.getAdditionalLeftNodes() != null)
            {
View Full Code Here

            List<QueryGraphValuePairInKWMultiIdx> multis = queryGraphValue.getInKeywordMulti();
            if (!multis.isEmpty()) {
                QueryGraphValuePairInKWMultiIdx multi = multis.get(0);
                List<QueryPlanIndexItem> indexSet = new ArrayList<QueryPlanIndexItem>();
                for (ExprNode propIndexed : multi.getIndexed()) {
                    ExprIdentNode identNode = (ExprIdentNode) propIndexed;
                    QueryPlanIndexItem indexItem = new QueryPlanIndexItem(new String[] {identNode.getResolvedPropertyName()}, null, null, null, false);
                    indexSet.add(indexItem);
                }
                QueryPlanIndex queryPlanIndex = QueryPlanIndex.makeIndex(indexSet);
                Set<String> indexNames = queryPlanIndex.getItems().keySet();
                String[] indexNameArray = indexNames.toArray(new String[indexNames.size()]);
View Full Code Here

                    List<QueryGraphValuePairInKWMultiIdx> multis = value.getInKeywordMulti();
                    if (!multis.isEmpty()) {
                        QueryGraphValuePairInKWMultiIdx multi = multis.get(0);
                        for (ExprNode propIndexed : multi.getIndexed()) {
                            ExprIdentNode identNode = (ExprIdentNode) propIndexed;
                            QueryPlanIndexItem indexItem = new QueryPlanIndexItem(new String[] {identNode.getResolvedPropertyName()}, null, null, null, false);
                            checkDuplicateOrAdd(indexItem, indexesSet);
                        }
                    }
                    continue;
                }
View Full Code Here

                             QueryGraph queryGraph) {
        if ( ((target instanceof ExprIdentNode)) &&
             ((start instanceof ExprIdentNode)) &&
             ((end instanceof ExprIdentNode)) )
        {
            ExprIdentNode identNodeValue = (ExprIdentNode) target;
            ExprIdentNode identNodeStart = (ExprIdentNode) start;
            ExprIdentNode identNodeEnd = (ExprIdentNode) end;

            int keyStreamStart = identNodeStart.getStreamId();
            int keyStreamEnd = identNodeEnd.getStreamId();
            int valueStream = identNodeValue.getStreamId();
            queryGraph.addRangeStrict(keyStreamStart, identNodeStart, keyStreamEnd,
                    identNodeEnd, valueStream,
                    identNodeValue,
                    includeStart, includeEnd, isNot);
            return;
        }

        // handle constant-compare or transformation case
        if (target instanceof ExprIdentNode) {
            ExprIdentNode identNode = (ExprIdentNode) target;
            int indexedStream = identNode.getStreamId();

            EligibilityDesc eligibilityStart = EligibilityUtil.verifyInputStream(start, indexedStream);
            if (!eligibilityStart.getEligibility().isEligible()) {
                return;
            }
View Full Code Here

TOP

Related Classes of com.espertech.esper.epl.expression.ExprIdentNode

Copyright © 2018 www.massapicom. 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.