本文整理汇总了C#中ExpressionVisitor.ToReducers方法的典型用法代码示例。如果您正苦于以下问题:C# ExpressionVisitor.ToReducers方法的具体用法?C# ExpressionVisitor.ToReducers怎么用?C# ExpressionVisitor.ToReducers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExpressionVisitor
的用法示例。
在下文中一共展示了ExpressionVisitor.ToReducers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderPartitionedAggregatePlan
public static PartitionedAggregatePlan RenderPartitionedAggregatePlan(Workspace Home, HScriptParser.Crudam_aggregateContext context)
{
// Get the data source //
DataSet data = VisitorHelper.GetData(Home, context.full_table_name());
string alias =
(context.K_AS() != null)
? context.IDENTIFIER().GetText()
: data.Name;
// Create a register //
StaticRegister memory = new StaticRegister(null);
// Create expression visitor //
ExpressionVisitor exp_vis = new ExpressionVisitor(null, Home, alias, data.Columns, memory);
// Get where //
Predicate where = VisitorHelper.GetWhere(exp_vis, context.where_clause());
// Get the reader //
//RecordReader reader = data.OpenReader(where);
// Get the keys //
FNodeSet keys =
(context.K_BY() != null)
? exp_vis.ToNodes(context.expression_alias_list())
: new FNodeSet();
// Get the reducers //
AggregateSet values =
(context.K_OVER() != null)
? exp_vis.ToReducers(context.beta_reduction_list())
: new AggregateSet();
// Create a second register for the return memory //
StaticRegister return_memory = new StaticRegister(null);
// Need to build a visitor off of the aggregator schema //
ExpressionVisitor agg_vis = new ExpressionVisitor(null, Home, "agg", AggregatePlan.GetInterimSchema(keys, values), return_memory);
// Get the output //
FNodeSet return_vars = VisitorHelper.GetReturnStatement(agg_vis, context.return_action().expression_or_wildcard_set());
// Get the output cursor //
RecordWriter out_put_writter = VisitorHelper.GetWriter(Home, return_vars.Columns, context.return_action());
// Get the partitioner //
int Partitions = VisitorHelper.GetPartitions(exp_vis, context.partitions());
return new PartitionedAggregatePlan(out_put_writter, data, where, keys, values, return_vars, Home.TempSpace, Partitions);
}