Пример #1
0
        public static CompositeIndexQuery MakeJoinSingleLookupStream(
            bool isNWOnTrigger,
            int lookupStream,
            ExprEvaluator hashGetter,
            QueryGraphValueEntryRange[] rangeProps)
        {
            // construct chain
            IList<CompositeIndexQuery> queries = new List<CompositeIndexQuery>();
            if (hashGetter != null) {
                queries.Add(new CompositeIndexQueryKeyed(false, lookupStream, -1, hashGetter));
            }

            foreach (QueryGraphValueEntryRange rangeProp in rangeProps) {
                queries.Add(new CompositeIndexQueryRange(isNWOnTrigger, lookupStream, -1, rangeProp));
            }

            // Hook up as chain for remove
            CompositeIndexQuery last = null;
            foreach (CompositeIndexQuery action in queries) {
                last?.SetNext(action);

                last = action;
            }

            return queries[0];
        }
Пример #2
0
        public static CompositeIndexQuery MakeSubordinate(
            bool isNWOnTrigger,
            int numOuterStreams,
            ExprEvaluator hashEval,
            QueryGraphValueEntryRange[] rangeEvals)
        {
            // construct chain
            IList<CompositeIndexQuery> queries = new List<CompositeIndexQuery>();
            if (hashEval != null) {
                queries.Add(new CompositeIndexQueryKeyed(isNWOnTrigger, -1, numOuterStreams, hashEval));
            }

            foreach (QueryGraphValueEntryRange rangeProp in rangeEvals) {
                queries.Add(new CompositeIndexQueryRange(isNWOnTrigger, -1, numOuterStreams, rangeProp));
            }

            // Hook up as chain for remove
            CompositeIndexQuery last = null;
            foreach (CompositeIndexQuery action in queries) {
                last?.SetNext(action);

                last = action;
            }

            return queries[0];
        }
Пример #3
0
        public static CompositeIndexQuery MakeSubordinate(
            bool isNWOnTrigger,
            int numOuterStreams,
            ICollection <SubordPropHashKey> keyExpr,
            Type[] coercionKeyTypes,
            ICollection <SubordPropRangeKey> rangeProps,
            Type[] rangeCoercionTypes,
            IList <String> expressionTexts)
        {
            // construct chain
            IList <CompositeIndexQuery> queries = new List <CompositeIndexQuery>();

            if (keyExpr.Count > 0)
            {
                IList <QueryGraphValueEntryHashKeyed> hashKeys = new List <QueryGraphValueEntryHashKeyed>();
                foreach (SubordPropHashKey keyExp in keyExpr)
                {
                    expressionTexts.Add(ExprNodeUtility.ToExpressionStringMinPrecedenceSafe(keyExp.HashKey.KeyExpr));
                    hashKeys.Add(keyExp.HashKey);
                }
                queries.Add(new CompositeIndexQueryKeyed(isNWOnTrigger, -1, numOuterStreams, hashKeys, coercionKeyTypes));
            }
            int count = 0;

            foreach (SubordPropRangeKey rangeProp in rangeProps)
            {
                Type coercionType = rangeCoercionTypes == null ? null : rangeCoercionTypes[count];
                queries.Add(new CompositeIndexQueryRange(isNWOnTrigger, -1, numOuterStreams, rangeProp, coercionType, expressionTexts));
                count++;
            }

            // Hook up as chain for remove
            CompositeIndexQuery last = null;

            foreach (CompositeIndexQuery action in queries)
            {
                if (last != null)
                {
                    last.SetNext(action);
                }
                last = action;
            }
            return(queries[0]);
        }
Пример #4
0
        public static CompositeIndexQuery MakeJoinSingleLookupStream(
            bool isNWOnTrigger,
            int lookupStream,
            IList <QueryGraphValueEntryHashKeyed> hashKeys,
            IList <Type> keyCoercionTypes,
            IList <QueryGraphValueEntryRange> rangeProps,
            IList <Type> rangeCoercionTypes)
        {
            // construct chain
            IList <CompositeIndexQuery> queries = new List <CompositeIndexQuery>();

            if (hashKeys.Count > 0)
            {
                queries.Add(new CompositeIndexQueryKeyed(false, lookupStream, -1, hashKeys, keyCoercionTypes));
            }
            int count = 0;

            foreach (QueryGraphValueEntryRange rangeProp in rangeProps)
            {
                Type coercionType       = rangeCoercionTypes == null ? null : rangeCoercionTypes[count];
                SubordPropRangeKey rkey = new SubordPropRangeKey(rangeProp, coercionType);
                queries.Add(
                    new CompositeIndexQueryRange(isNWOnTrigger, lookupStream, -1, rkey, coercionType, new List <String>()));
                count++;
            }

            // Hook up as chain for remove
            CompositeIndexQuery last = null;

            foreach (CompositeIndexQuery action in queries)
            {
                if (last != null)
                {
                    last.SetNext(action);
                }
                last = action;
            }
            return(queries[0]);
        }