private IASTNode CreateAggregationSegment(MySqlCommandParser.AggregationFunctionContext ctx, String aggregationType) { AggregationTypeEnum type = AggregationType.ValueOf(aggregationType.ToUpper()); int innerExpressionStartIndex = ((ITerminalNode)ctx.GetChild(1)).Symbol.StartIndex; if (null == ctx.distinct()) { return(new AggregationProjectionSegment(ctx.Start.StartIndex, ctx.Stop.StopIndex, type, innerExpressionStartIndex)); } return(new AggregationDistinctProjectionSegment(ctx.Start.StartIndex, ctx.Stop.StopIndex, type, innerExpressionStartIndex, getDistinctExpression(ctx))); }
private IASTNode CreateAggregationSegment(SqlServerCommandParser.AggregationFunctionContext context, string aggregationType) { var type = AggregationType.ValueOf(aggregationType.ToUpper()); int innerExpressionStartIndex = ((ITerminalNode)context.GetChild(1)).Symbol.StartIndex; if (null == context.distinct()) { return(new AggregationProjectionSegment(context.Start.StartIndex, context.Stop.StopIndex, type, innerExpressionStartIndex)); } return(new AggregationDistinctProjectionSegment(context.Start.StartIndex, context.Stop.StopIndex, type, innerExpressionStartIndex, GetDistinctExpression(context))); }