Exemplo n.º 1
0
        public override IList <string> GetColumns()
        {
            var safeGetColumns = new Func <string, IList <string> >(nodeId =>
            {
                if (InputDict.ContainsKey(nodeId))
                {
                    return(InputDict[nodeId].GetColumns());
                }
                else
                {
                    return(new List <string>());
                }
            });

            var columnLists = Inputs.Select(i => safeGetColumns(i));

            if (columnLists.Any())
            {
                if (IncludeUniqueColumns)
                {
                    // build a full column list from all inputs
                    return(columnLists.Aggregate((x, y) => new List <string>(new HashSet <string>(x).Union(y))));
                }
                else
                {
                    // build an intersection of the column lists from all inputs
                    return(columnLists.Aggregate((x, y) => new List <string>(new HashSet <string>(x).Intersect(y))));
                }
            }
            else
            {
                return(new List <string>());
            }
        }
Exemplo n.º 2
0
        public override IList <string> GetColumnTypes()
        {
            if (Inputs.All(i => InputDict.ContainsKey(i)))
            {
                var input1 = InputDict[Inputs[0]];
                var input2 = InputDict[Inputs[1]];

                var result = new List <string>();
                result.AddRange(input1.GetColumnTypes().Select(c => c));
                result.AddRange(input2.GetColumnTypes().Select(c => c));
                return(result);
            }
            else
            {
                return(new List <string>());
            }
        }