示例#1
0
 public IXTable Build(IXTable source, XDatabaseContext context)
 {
     // Set can be evaluated in parallel, so keep parallel
     return(source.WrapParallel(context.Parser, (part) =>
                                new Set(
                                    part,
                                    context.Parser.NextOutputColumnName(part),
                                    context.Parser.NextColumn(part, context))
                                ));
 }
示例#2
0
        public IXTable Build(IXTable source, XDatabaseContext context)
        {
            Dictionary <string, string> columnNameMappings = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);

            while (context.Parser.HasAnotherPart)
            {
                columnNameMappings[context.Parser.NextColumnName(source)] = context.Parser.NextOutputColumnName(source);
            }

            // Rename can be evaluated in parallel, so keep parallel
            return(source.WrapParallel(context.Parser, (part) => new Rename(part, columnNameMappings)));
        }
示例#3
0
        public IXTable Build(IXTable source, XDatabaseContext context)
        {
            List <string> columnNames = new List <string>();

            while (context.Parser.HasAnotherPart)
            {
                columnNames.Add(context.Parser.NextColumnName(source));
            }

            // Remove can be evaluated in parallel, so keep parallel
            return(source.WrapParallel(context.Parser, (part) => new Remove(part, columnNames)));
        }
示例#4
0
        public IXTable Build(IXTable source, XDatabaseContext context)
        {
            // Select can be evaluated in parallel, so keep parallel
            return(source.WrapParallel(context.Parser, (part) =>
            {
                List <IXColumn> columns = new List <IXColumn>();
                do
                {
                    IXColumn column = context.Parser.NextColumn(part, context);
                    columns.Add(column);
                    if (String.IsNullOrEmpty(column.ColumnDetails.Name))
                    {
                        throw new ArgumentException($"Column {columns.Count} passed to 'Column' wasn't assigned a name. Use 'AS [Name]' to assign names to every column selected.");
                    }
                } while (context.Parser.HasAnotherPart);

                return new Select(part, columns);
            }));
        }
示例#5
0
 public IXTable Build(IXTable source, XDatabaseContext context)
 {
     // Where can be evaluated in parallel, so keep parallel
     return(source.WrapParallel(context.Parser, (part) => new Where(part, context.Parser.NextExpression(part, context))));
 }
示例#6
0
 public IXTable Build(IXTable source, XDatabaseContext context)
 {
     // Cast can be evaluated in parallel, so keep parallel
     return(source.WrapParallel(context.Parser, (part) => new Cast(part, _castFunctionBuilder.Build(part, context))));
 }