public override IList<int[]> Evaluate(GroupByRollupEvalContext context)
        {
            var result = new int[expressions.Count];
            for (var i = 0; i < expressions.Count; i++) {
                int index = context.GetIndex(expressions[i]);
                result[i] = index;
            }

            Collections.SortInPlace(result);

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

            return Collections.SingletonList(result);
        }
예제 #2
0
 public override IList<int[]> Evaluate(GroupByRollupEvalContext context)
 {
     int index = context.GetIndex(expression);
     return Collections.SingletonList(new[] {index});
 }