Пример #1
0
        public override IList <int[]> Evaluate(GroupByRollupEvalContext context)
        {
            var result = new int[_expressions.Count];

            for (int i = 0; i < _expressions.Count; i++)
            {
                int index = context.GetIndex(_expressions[i]);
                result[i] = index;
            }

            result.SortInPlace();

            // find dups
            for (int i = 0; i < result.Length - 1; i++)
            {
                if (result[i] == result[i + 1])
                {
                    throw new GroupByRollupDuplicateException(
                              new int[]
                    {
                        result[i]
                    });
                }
            }

            return(Collections.SingletonList(result));
        }
Пример #2
0
        public override IList <int[]> Evaluate(GroupByRollupEvalContext context)
        {
            int index = context.GetIndex(_expression);

            return(Collections.SingletonList(
                       new int[]
            {
                index
            }));
        }