Exemple #1
0
        // Filter and Select
        public Object[] TypableEvaluate(
            EventBean[] eventsPerStream,
            bool isNewData,
            ICollection <EventBean> matchingEvents,
            ExprEvaluatorContext exprEvaluatorContext,
            ExprSubselectRowNode parent)
        {
            var events          = EventBeanUtility.AllocatePerStreamShift(eventsPerStream);
            var subSelectResult = ExprSubselectRowNodeUtility.EvaluateFilterExpectSingleMatch(
                events, isNewData, matchingEvents, exprEvaluatorContext, parent);

            if (subSelectResult == null)
            {
                return(null);
            }

            events[0] = subSelectResult;
            var selectClauseEvaluator = parent.SelectClauseEvaluator;
            var results        = new Object[selectClauseEvaluator.Length];
            var evaluateParams = new EvaluateParams(events, isNewData, exprEvaluatorContext);

            for (var i = 0; i < results.Length; i++)
            {
                results[i] = selectClauseEvaluator[i].Evaluate(evaluateParams);
            }
            return(results);
        }
Exemple #2
0
        // Filter and Select
        public Object Evaluate(
            EventBean[] eventsPerStream,
            bool newData,
            ICollection <EventBean> matchingEvents,
            ExprEvaluatorContext exprEvaluatorContext,
            ExprSubselectRowNode parent)
        {
            var eventsZeroBased = EventBeanUtility.AllocatePerStreamShift(eventsPerStream);
            var subSelectResult = ExprSubselectRowNodeUtility.EvaluateFilterExpectSingleMatch(
                eventsZeroBased, newData, matchingEvents, exprEvaluatorContext, parent);

            if (subSelectResult == null)
            {
                return(null);
            }

            eventsZeroBased[0] = subSelectResult;
            Object result;

            if (parent.SelectClauseEvaluator.Length == 1)
            {
                result = parent.SelectClauseEvaluator[0].Evaluate(new EvaluateParams(eventsZeroBased, true, exprEvaluatorContext));
            }
            else
            {
                // we are returning a Map here, not object-array, preferring the self-describing structure
                result = parent.EvaluateRow(eventsZeroBased, true, exprEvaluatorContext);
            }

            return(result);
        }
        // Filter and Select
        public EventBean EvaluateGetEventBean(EventBean[] eventsPerStream, bool isNewData, ICollection <EventBean> matchingEvents, ExprEvaluatorContext context, ExprSubselectRowNode parent)
        {
            var events          = EventBeanUtility.AllocatePerStreamShift(eventsPerStream);
            var subSelectResult = ExprSubselectRowNodeUtility.EvaluateFilterExpectSingleMatch(events, isNewData, matchingEvents, context, parent);

            if (subSelectResult == null)
            {
                return(null);
            }
            var row = parent.EvaluateRow(events, true, context);

            return(parent.subselectMultirowType.EventAdapterService.AdapterForTypedMap(row, parent.subselectMultirowType.EventType));
        }
Exemple #4
0
        // Filter and no-select
        public virtual object Evaluate(
            EventBean[] eventsPerStream,
            bool newData,
            ICollection <EventBean> matchingEvents,
            ExprEvaluatorContext exprEvaluatorContext,
            ExprSubselectRowNode parent)
        {
            EventBean[] eventsZeroBased = EventBeanUtility.AllocatePerStreamShift(eventsPerStream);
            EventBean   subSelectResult = ExprSubselectRowNodeUtility.EvaluateFilterExpectSingleMatch(eventsZeroBased, newData, matchingEvents, exprEvaluatorContext, parent);

            if (subSelectResult == null)
            {
                return(null);
            }
            return(subSelectResult.Underlying);
        }
        public override Object Evaluate(
            EventBean[] eventsPerStream,
            bool newData,
            ICollection <EventBean> matchingEvents,
            ExprEvaluatorContext exprEvaluatorContext,
            ExprSubselectRowNode parent)
        {
            EventBean[] eventsZeroBased = EventBeanUtility.AllocatePerStreamShift(eventsPerStream);
            EventBean   subSelectResult = ExprSubselectRowNodeUtility.EvaluateFilterExpectSingleMatch(
                eventsZeroBased, newData, matchingEvents, exprEvaluatorContext, parent);

            if (subSelectResult == null)
            {
                return(null);
            }
            return(_tableMetadata.EventToPublic.ConvertToUnd(
                       subSelectResult, new EvaluateParams(eventsPerStream, newData, exprEvaluatorContext)));
        }