public static QsiColumnsDeclarationNode VisitSelectElements(SelectElementsContext context) { return(TreeHelper.Create <QsiColumnsDeclarationNode>(n => { if (context.star != null) { n.Columns.Add(new QsiAllColumnNode()); } n.Columns.AddRange(context.selectElement().Select(VisitSelectElement)); })); }
public static IColumn[] VisitSelectElements(SelectElementsContext context) { if (context.star != null) { return(new IColumn[] { new StarColumn() }); } IColumn[] columns = context.selectElement().Select(VisitSelectElement).ToArray(); if (columns.Any(c => c is CountFunctionColumn) && columns.Length > 1) { throw new InvalidOperationException("Count function can only use in single column."); } return(columns); }