public AggregateStage AddProjection(IDonutFunction function) { var stage = new AggregateStage(_script, function); Stages.Add(stage); return(stage); }
public AggregateStage(IDonutScript script, IDonutFunction function) { Function = function; _script = script; ChildStages = new List <AggregateStage>();//new AggregateJobTree(script); switch (function.Type) { case DonutFunctionType.Project: Type = AggregateStageType.Project; break; case DonutFunctionType.GroupField: Type = AggregateStageType.Group; break; } }
/// <summary> /// /// </summary> /// <param name="function"></param> /// <param name="expParameters"></param> /// <returns></returns> public IDonutFunction GetFunction(string function) { IDonutFunction output = null; var lower = function.ToLower(); if (Functions.ContainsKey(lower)) { output = Functions[lower].Clone(); } else { throw new Exception($"Unsupported js function: {function}"); } return(output); }
public static DonutFunction Wrap(IDonutFunction df) { return(df as DonutFunction); }