/// <summary>
        /// Format summarize expression
        /// </summary>
        /// <param name="summarizeExpression">the expression to be formatted</param>
        /// <returns>the original expression</returns>
        protected override Expression VisitSummarizeExpression(SummarizeExpression summarizeExpression)
        {
            if (summarizeExpression.AllColumns != null && summarizeExpression.AllColumns.Any())
            {
                this.Builder.Append("\tSUMMARIZE(\n");
                this.Visit(TableFactory.GetTableExpression(summarizeExpression.MainTable));

                if (summarizeExpression.Columns.Any())
                {
                    IEnumerable <string> cs =
                        summarizeExpression.Columns.Select(c => ((ColumnExpression)c.Expression).DbName).Distinct();
                    string columnString = cs.Aggregate((c1, c2) => c1 + ",\n" + c2);
                    this.Builder.Append(",");
                    this.Builder.Append(columnString);
                }

                if (summarizeExpression.Measures.Any())
                {
                    this.VisitMeasures(summarizeExpression.Measures);
                    this.Builder.Append(")");
                }
                else
                {
                    this.Builder.Append(")");
                }
            }
            else
            {
                return(this.Visit(summarizeExpression.MainTable));
            }

            return(summarizeExpression);
        }